1.結(jié)構(gòu)性選著器
1.1
div+p{
background-color:yellow;
}
代碼演示:
<!DOCTYPE html>
<html>
<head>
<style>
div+p
{
background-color:yellow;
}
</style>
</head>
<body>
<h1>歡迎來到我到的主頁</h1>
<div>
<p>我是唐老鴨拔稳。</p>
<p>我住在 Duckburg题翻。</p>
</div>
<p>我最好的朋友是米老鼠。</p>
<p>我的樣式不會改變焕参。</p>
</body>
</html>
效果演示:
20170214095949.png
1.2
p~ul
{
background:#ff0000;
}
代碼演示:
<!DOCTYPE html>
<html>
<head>
<style>
p~ul
{
background:#ff0000;
}
</style>
</head>
<body>
<div>一個 div 元素。</div>
<ul>
<li>咖啡</li>
<li>牛奶</li>
<li>茶</li>
</ul>
<p>第一段可免。</p>
<ul>
<li>咖啡</li>
<li>牛奶</li>
<li>茶</li>
</ul>
<h2>另一個列表</h2>
<ul>
<li>咖啡</li>
<li>牛奶</li>
<li>茶</li>
</ul>
</body>
</html>
效果演示:
![Uploading 20170214095949_438810.png . . .]
](http://upload-images.jianshu.io/upload_images/2906565-10b45b767805dd3a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2.字體圖標
2.1:使用方式
@font-face{
font-family: "wjs";
src:
url(../fonts/MiFie-Web-Font.eot) format("embedded-opentype"),
url(../fonts/MiFie-Web-Font.svg) format("svg"),
url(../fonts/MiFie-Web-Font.ttf) format("truetype"),
url(../fonts/MiFie-Web-Font.woff) format("woff");
}
.wjs_icon{
font-family: wjs;
}
/*通過偽類來定義一個字體圖標*/
/*字體圖標設(shè)計出來的時候一般都會有文檔參考*/
.wjs_icon_phone::before{
content: "\e908";
}
.wjs_icon_tel::before{
content: "\e909";
}
2.2:如何制作字體圖標
可以用軟件AI生成字體圖標耕漱,也可以百度在線生成字體圖標。