简体   繁体   English

display:run-in 是否可用? 如果没有,有什么替代方案?

[英]Is display:run-in usable? If not, what’s the alternative?

I'm trying to create a web page to mimic the appearance of a legal document in which section titles are bold-faced and run into the body of the first paragraph of the section.我正在尝试创建一个网页来模仿法律文件的外观,其中部分标题为粗体并与该部分第一段的正文相结合。 Something like this:像这样的东西:

Area.区域。 Minimum lot size five (5) acres with a minimum of two (2) acres excluding wetlands.最小地块面积五 (5) 英亩,至少两 (2) 英亩,不包括湿地。 (Amended March 1992.) (1992 年 3 月修订。)

Frontage.正面。 Two hundred (200) feet on a Class V or better road.在 V 级或更好的道路上行驶两百 (200) 英尺。 (Amended March 1999.) (1999 年 3 月修订。)

Setbacks.挫折。 Two hundred (200) feet from all park lines.距所有公园线两百 (200) 英尺。

The obvious HTML would be显而易见的 HTML 是

<h3>Area.</h3>
<p>Minimum lot size five (5) acres with a minimum of two (2) acres excluding wetlands. 
(Amended March 1992.)</p>
<h3>Frontage.</h3>
<p>Two hundred (200) feet on a Class V or better road. (Amended March 1999.)</p>
<h3>Setbacks.</h3>
<p>Two hundred (200) feet from all park lines.</p>

This looks like exactly what CSS display: run-in was created for.这看起来正是 CSS display: run-in目的。 But from what I've read, display: run-in is pretty-much dead.但从我所读到的, display: run-in几乎已经死了。

Is there a good alternative?有没有好的替代方案?

This is a good case for float:这是浮动的一个很好的例子:

 h3 { font-weight: bold; float: left; margin: 0 5px; font-size: initial; }
 <h3>Area.</h3> <p>Minimum lot size five (5) acres with a minimum of two (2) acres excluding wetlands. (Amended March 1992.)</p> <h3>Frontage.</h3> <p>Two hundred (200) feet on a Class V or better road. (Amended March 1999.)</p> <h3>Setbacks.</h3> <p>Two hundred (200) feet from all park lines.</p>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM