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.

但这不是一个很好的解决方案.请问有什么更好的吗?

非常感谢你!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值