有没有办法将不同大小的多个标题的第一行与同一基线对齐?也不管后面的文本,也应该对齐.
编辑:重新上传:
在我看来,唯一的解决方案是将每个标题和每个正文文本放入单独的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.
但这不是一个很好的解决方案.请问有什么更好的吗?
非常感谢你!