display: run-in

If a sibling block box (that does not float and is not absolutely positioned) follows the run-in box, the run-in box becomes the first inline box of the block box.
如果兄弟元素不是浮动和绝对定位,那么就会表现得像紧接着那个块元素的第一个行内元素
 
A run-in cannot run in to a block that already starts with a run-in or that itself is a run-in.
不可以跑进已经由run in开头,或者本省就是run in的元素里
 
If the run-in element contains anything block-level, it becomes block-level
 

可以让标题和后面的文字出现在同一行,不用牺牲语义化,用其他方式实现容易遇到各种问题

h3{display:run-in}
display: run-in
 display: run-in
例如用float来实现,会错开
display: run-in
 display: run-in
如果把标题变为inline元素,那么如果后面跟着一个图片,他就不会自动换行
 
上一篇:C#计算时间差 TimeSpan


下一篇:C# 获取指定目录下所有文件信息