伪元素生成空格与中文字符对齐布局实例页面

回到相关文章 »

代码:

CSS代码:
.half {
    *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' ');
}
.full {
    *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' ');
}
.half:before { content: '\2002'; speak: none; }
.full:before { content: '\2003'; speak: none; }
                
HTML代码:
<ul>
    <li class="li">姓<span class="full"></span><span class="full"></span>名:<input type="text" /></li>
    <li class="li">手<span class="half"></span>机<span class="half"></span>号:<input type="text" /></li>
    <li class="li">电子邮箱:<input type="text" /></li>
</ul>
                

效果:

  • 名:
  • 号:
  • 电子邮箱: