代码如下:
icon对齐神技 a { text-decoration: none; color: #333; } /*全局统一lineheight,与icon高度一致*/ body { font-size: 14px; line-height: 20px; } .icon { display: inline-block; background: url('toplist.png') no-repeat 2px -139px; width: 20px; height: 20px; white-space:nowrap; /*设置文本不换行,防止溢出的文字破环格局*/ letter-spacing: -1em; text-indent: -99em; /*首行缩进设置负值,使得标签内的文字不显示*/ color: transparent; /* IE7 */ *text-indent: 0; *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '\3000'); } .icon:before { content: '\3000'; } 使用空标签i
某些东西 使用a标签,标签内有文字
某些东西某些东西
查看更多关于网页icon和文本对齐神技2016.03.23_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did112315