在HTML中各分類盒子的基線應(yīng)如何確定
發(fā)表時(shí)間:2023-09-16 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]這次給大家?guī)碓贖TML中各類型盒子的基線應(yīng)如何確定,在HTML中各類型盒子的基線確定的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。確定盒子的基線的規(guī)則1.1 確定inline-block的基線The baseline of an inline-block is the baseline...
這次給大家?guī)碓贖TML中各類型盒子的基線應(yīng)如何確定,在HTML中各類型盒子的基線確定的
注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。
確定盒子的基線的規(guī)則
1.1 確定inline-block的基線
The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge.
1.2 確定replacement的基線
bottom margin edge
1.3 確定inline的基線
就是它所包含的那些文字的基線
1.4 確定inline-table的基線
The baseline of an 'inline-table' is the baseline of the first row of the table
1.5 確定block的基線
每個(gè)block一般都含有很多行的元素,所以它的基線也有很多條,每條對(duì)應(yīng)一個(gè)line-box,line-box的基線確定稍復(fù)雜,看第二章
1.6 確定flex-box每行的基線(可能未來需要改)
拿一行中高度最高的Flex-item的第一行文字的基線當(dāng)做flex-box當(dāng)前行的基線
1.7 確定line-box的基線(較復(fù)雜)
首先不同于其他類型的盒子,CSS 2.1 does not define the position of the line box's baseline,所以它的基線是不確定的,會(huì)隨著行內(nèi)元素的內(nèi)容或樣式的改變而改變。具體怎么改變看第二小節(jié)
哪些因素會(huì)影響line-box的基線的位置
當(dāng)一行內(nèi)有一個(gè)elem與line-box同等高度時(shí)
因?yàn)樵匾呀?jīng)與當(dāng)前行等高了,所以在這個(gè)elem上設(shè)置的vertical-align對(duì)它本身是沒有視覺上的任何效果的,但會(huì)影響當(dāng)前l(fā)ine-box的基線的位置。
當(dāng)一行內(nèi)有多個(gè)vertical-align值互不相同的元素時(shí), line-box的基線的位置也會(huì)為了同時(shí)滿足這些個(gè)所有的vertical-align值而把line-box的基線移動(dòng)到恰當(dāng)?shù)奈恢脼橹梗30殡S浙line-box的高度也會(huì)隨之變化
相信看了這些案例你已經(jīng)掌握了方法,更多精彩請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!
相關(guān)閱讀:
html怎樣重定向連接
div標(biāo)簽中的元素margin-top失效的解決方法
iframe的子頁面怎樣操作父頁屏蔽頁面彈出層效果
以上就是在HTML中各類型盒子的基線應(yīng)如何確定的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!
網(wǎng)站建設(shè)是一個(gè)廣義的術(shù)語,涵蓋了許多不同的技能和學(xué)科中所使用的生產(chǎn)和維護(hù)的網(wǎng)站。