星空网 > 软件开发 > 网页设计

css笔记——小图标文字对齐中级解决方案

出处:http://www.zhangxinxu.com/study/201603/icon-text-vertical-align.html

css

.icon {   display: inline-block;   width:20px; height:20px;   background: url(delete.png) no-repeat center;   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'; }

html

<strong>情形1,空标签</strong><p><i ></i> 删除</p><strong>情形2,内部有文字</strong><p><a href="javascript:" >删除</a> 后面的文字</p><p >--------下面是反例------</p><strong>设置了overflow:hidden</strong><p><i ></i> 删除</p>

 

效果图1 小字号

css笔记——小图标文字对齐中级解决方案  

 

2 大字号

css笔记——小图标文字对齐中级解决方案

 

  




原标题:css笔记——小图标文字对齐中级解决方案

关键词:CSS

CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

易仓科技海外仓:https://www.goluckyvip.com/tag/47616.html
易仓有海外仓吗:https://www.goluckyvip.com/tag/47617.html
易舱网:https://www.goluckyvip.com/tag/47618.html
易诚仓储:https://www.goluckyvip.com/tag/47619.html
易达丰:https://www.goluckyvip.com/tag/47621.html
易达丰国际物流:https://www.goluckyvip.com/tag/47622.html
最新研究:亚马逊、沃尔玛、Temu和Shein卖家重合率不断攀升:https://www.kjdsnews.com/a/1836554.html
三清山好玩乜?:https://www.vstour.cn/a/365182.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流