確定盒子的基線的規則
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 html' target='_blank'>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的基線
每個block一般都含有很多行的元素,所以它的基線也有很多條,每條對應一個line-box,line-box的基線確定稍復雜,看第二章
1.6 確定flex-box每行的基線(可能未來需要改)
拿一行中高度最高的Flex-item的第一行文字的基線當做flex-box當前行的基線
1.7 確定line-box的基線(較復雜)
首先不同于其他類型的盒子,CSS 2.1 does not define the position of the line box s baseline,所以它的基線是不確定的,會隨著行內元素的內容或樣式的改變而改變。具體怎么改變看第二小節
哪些因素會影響line-box的基線的位置
當一行內有一個elem與line-box同等高度時
因為元素已經與當前行等高了,所以在這個elem上設置的vertical-align對它本身是沒有視覺上的任何效果的,但會影響當前line-box的基線的位置。
當一行內有多個vertical-align值互不相同的元素時, line-box的基線的位置也會為了同時滿足這些個所有的vertical-align值而把line-box的基線移動到恰當的位置為止,常常伴隨浙line-box的高度也會隨之變化
相信看了這些案例你已經掌握了方法,更多精彩請關注php 其它相關文章!
相關閱讀:
html怎樣重定向連接
div標簽中的元素margin-top失效的解決方法
iframe的子頁面怎樣操作父頁屏蔽頁面彈出層效果
以上就是在HTML中各類型盒子的基線應如何確定的詳細內容,html教程
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。
新聞熱點
疑難解答