运行<!DOCTYPE html>
<style>
div {
border:1px solid red;
width:200px;
height:100px;
line-height:100px;
text-align:center;
}
span {vertical-align:middle;}
#box {
display:inline-block;
width:100px;
height:98px;
background:#EEE;
}
</style>
<div>
abc<span id="box"></span>def
</div>
运行<!DOCTYPE html>
<style>
div {
border:1px solid red;
width:200px;
height:100px;
line-height:100px;
text-align:center;
font-size:0px;
}
span {
vertical-align:middle;
display:inline-block;
font-size:1rem;
}
#box {
width:100px;
height:98px;
background:#EEE;
}
</style>
<div>
<span>abc</span><span id="box"></span><span>def</span>
</div>
联系客服