html调整文字位在基线显示,html – 将标题对齐到相同的基线,无论后续文字是什么?...
有沒有辦法將不同大小的多個標題的第一行與同一基線對齊?也不管后面的文本,也應該對齊.
編輯:重新上傳:
在我看來,唯一的解決方案是將每個標題和每個正文文本放入單獨的DIV,然后使用標題來填充頂部或邊緣頂部以對齊它們(例如H1將是36px,0px邊距,而H3將是24px,12px上邊距).像這樣的東西:
div {
width: 240px;
float: left;
}
h1 {
font-size: 36px;
margin: 0;
padding: 0;
}
h3 {
font-size: 24px;
margin: 0;
padding: 10px 0 0 0; /*for some reason I must use 10px instead of 12px to align. Why??*/
}
H1 heading
H3 heading
H3 heading that is somewhat longer and spans multiple lines
There are many variations of passages of Lorem Ipsum available,but the majority have suffered alteration in some form,by injected humour,or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum,you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary,making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words,combined with a handful of model sentence structures,to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition,injected humour,or non-characteristic words etc.
There are many variations of passages of Lorem Ipsum available,or non-characteristic words etc.
但這不是一個很好的解決方案.請問有什么更好的嗎?
非常感謝你!
總結
以上是生活随笔為你收集整理的html调整文字位在基线显示,html – 将标题对齐到相同的基线,无论后续文字是什么?...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: url中能出现的字符_网站URL配置4个
- 下一篇: 正交变换在基下的矩阵都是可逆阵_矩阵分析