标签:ack images att 切割 orm 自己 兼容性 c11 背景
<ul class="layout"> <li><a href=""><i style="color: #efe0ce;" class="imooc-icon">?</i></a></li> <li><a href=""><i style="color: #ef7073;" class="imooc-icon">?</i></a></li> <li><a href=""><i style="color: #78ade3;" class="imooc-icon"></i></a></li> <li><a href=""><i style="color: #eae77f;" class="imooc-icon"></i></a></li> <li><a href=""><i style="color: #3c3c3c;" class="imooc-icon"></i></a></li> <li><a href=""><i style="font-size:30px;" class="imooc-icon"></i></a></li> <li><a href=""><i style="font-size:60px;" class="imooc-icon"></i></a></li> <li><a href=""><i style="font-size:90px;" class="imooc-icon"></i></a></li> <li><a href=""><i style="font-size:120px;" class="imooc-icon"></i></a></li> <li><a href=""><i style="font-size:148px;" class="imooc-icon"></i></a></li> </ul> 打开已经下载font字体图标demo.html 里边有相关的图标代码f048 ,但是浏览器需要添加&#x才可以识别
@font-face{ font-family: "imooc-icon"; src: url("../fonts/icomoon.eot"); /* IE9 兼容模式 */ src: url("../fonts/icomoon.eot?#iefix") format("embedded-opentype")/* IE6-IE8 */ ,url("../fonts/icomoon.woff") format("woff")/* chrome, firefox */ ,url("../fonts/icomoon.ttf") format("truetype")/* chrome, firefox, opera, Safari,Android, iOS 4.2+*/ ,url("../fonts/icomoon.svg") format("svg");/* iOS 4.1- */ font-weight: normal; font-style: normal; } .imooc-icon{ font-family: "imooc-icon"; font-style: normal; font-weight: normal; font-size: 64px; -webkit-font-smoothing: antialiased;/* 防webkit内核浏览器锯齿*/ -moz-osx-font-smoothing: grayscale;/*防mac浏览器锯齿*/ } 其中 #iefix 解决ie6中无法显示的问题
<ul class="layout"> <li><i class="icon icon-heart"></i></li> <li><i class="icon icon-heart"></i></li> <li><i class="icon icon-heart"></i></li> <li><i class="icon icon-heart"></i></li> </ul>
@font-face{ font-family: "imooc"; src: url("../fonts/imooc.eot");/* IE9兼容 */ src: url("../fonts/imooc.eot?#iefix") format("embedded-opentype"), url("../fonts/imooc.woff") format("woff"), url("../fonts/imooc.ttf") format("truetype"), url("../fonts/imooc.svg") format("svg"); font-weight: normal; font-style: normal; } .icon{ font-family: "imooc"; font-weight: normal; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .icon-heart:before { /*对于before 伪元素 请自行百度*/ content: "\e600"; }
<ul class="sprite"> <li> <s style="background-position: 0 0;" class="s-icon"></s> <a href="">adsf</a> </li> <li> <s style="background-position: 0 -40px;" class="s-icon"></s> <a href="">adsfwfewe</a> </li> <li> <s style="background-position: 0 -80px;" class="s-icon"></s> <a href="">123123213213/a> </li> </ul>
.sprite{ margin: 10px auto; width: 206px; border: 1px solid #b51600; } .sprite li{ cursor: pointer; height: 42px; width: 206px; border-bottom: 1px solid #911001; border-top: 1px solid #c11e08; } .sprite li a { color: #fff; line-height: 42px; font-size: 14px; } .sprite li s{ height: 40px; width: 24px; display: block; margin-left: 10px; margin-right: 8px; float: left; background-image: url("../images/s-icon.png"); }
标签:ack images att 切割 orm 自己 兼容性 c11 背景
原文地址:http://www.cnblogs.com/phpworld/p/6972641.html