标签:
<style>
p {height: 30px; border: 1px solid black;}
// 查找含有属性test的p标签
p [test] {background: red;}
</style>
<body>
<p test="dhl">dhl</p>
<p test="xb">xiaobei</p>
</body>
<style>
p {height: 30px; border: 1px solid black;}
// 查找test属性值为dhl的p标签
p [test="dhl"] {background: red;}
</style>
<body>
<p test="dhl">dhl</p>
<p test="xb">xiaobei</p>
</body>
<style>
p {height: 30px; border: 1px solid black;}
// 查找含有属性test,并且属性值列表中含有young的p标签
p [test~="young"] {background: red;}
</style>
<body>
<p test="dhl young">dhl</p>
<p test="xb">xiaobei</p>
</body>
<style>
p {height: 30px; border: 1px solid black;}
// 查找含有属性test,并且属性值以"girl"开头的p标签
p [test^="girl"] {background: red;}
</style>
<body>
<p test="gjrldhl">dhl</p>
<p test="boyxb">xiaobei</p>
</body>
<style>
p {height: 30px; border: 1px solid black;}
// 查找含有属性test,并且属性值以"dhl"结尾的p标签
p [test$="dhl"] {background: red;}
</style>
<body>
<p test="gjrldhl">dhl</p>
<p test="boyxb">xiaobei</p>
</body>
<style>
p {height: 30px; border: 1px solid black;}
p: nth-child(1) {background: red;}
</style>
<body>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
</body>
<style>
div {width: 200px; height: 200px; background: black; font:50px/200px "微软雅黑"; color: #fff; text-align:center; display:none;}
div:target {display:block;}
</style>
<body>
<a href="#div1">div1</a>
<a href="#div2">div2</a>
<div id="div1"></div>
<div id="div2"></div>
</body>
<style>
input{width:100px;height:200px; color:#000;}
input:enabled {color;red;}
input:disabled {color:blue;}
</style>
<body>
<input type="text" value="请输入" disabled />
</body>
<style>
p~h1{background: red;}
</style>
<body>
<h1>h</h1>
// p标签之后的两个h1标签均变为红色
<p>p1</p>
<h1>red</h1>
<h1>red</h1>
</body>
<style>
p {widht: 300px; height: 300px; border: 1px solid black; font: 10px "微软雅黑"; padding: 10px;}
p: first-line{ background: red;}
p: first-letter{font-size: 30px;}
p::selection{background#F60; color: #690;}
<style>
<body>
<p>hahaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
</body>
<style>
h1:not(.h2){background: red;}
</style>
<body>
<h1>h1</h1>
<h1 class="h2>h1</h1>
<h1>h1</h1>
</body>
@font-face {
font-family: ‘miaov‘;
src: url(‘111-webfont.eot‘);
src: url(‘111-webfont.eot?#iefix‘) format(‘embedded-opentype‘),
url(‘111-webfont.woff‘) format(‘woff‘),
url(‘111-webfont.ttf‘) format(‘truetype‘),
url(‘111-webfont.svg#untitledregular‘) format(‘svg‘);
font-weight: normal;
font-style: normal;
}
标签:
原文地址:http://www.cnblogs.com/blingblingstar/p/4871295.html