我希望将文本片段放在同一行的另一部分之上:
<div>Th<div class="ac">Am</div>is is an ex<div class="ac">E</div>ample line</div>
会显示
Am E
This is an example line
答案 0 :(得分:1)
您应该可以使用以下设置执行此操作:
.ac {
position:relative; /*relative to the position it had in the line*/
top:-1em; /*move up exactly one line*/
width:0px; /*don't keep the width in the original line*/
display:inline-block; /*dont add a line break*/
}
body {
font-family:monospace
}