<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″ />
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<title></title>
<style type=”text/css”>
#nth-test div:nth-child(-n + 4) {
background-color: red;
}
</style>
</head>
<body>
<div id=”nth-test”>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
</div>
</body>
</html>
选前四个
#nth-test div:nth-child(-n + 4) { background-color: red; }
选弟3个往后
#nth-test div:nth-child(n + 3) { background-color: red; }
css圆角框,css img用法,css不换行标签,华为css的竞争对象,css标准初始化,css链接用什么标签页,css 缩放值计算