<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
body {
background-color: #CCCCCC;
}
div {
color: #cccccc;
font: 900 80px "微软雅黑";
}
div:first-child {
/ text-shadow: 水平位置 垂直位置 模糊距离 阴影颜色; /
text-shadow: 1px 1px 1px #000000, -1px -1px 1px #ffffff;
}
/ 这里不知道为什么last-child选不中最后的div /
/* div:last-child {
text-shadow: -1px -1px 1px #000000, 1px 1px 1px #ffffff;
} */
div:nth-child(2) {
text-shadow: -1px -1px 1px #000000, 1px 1px 1px #ffffff;
}
</style>
</head>
<body>
<div>
我是凸起的文字
</div>
<div>
我是凹下的文字
</div>
</body>
</html>
1 个回复
the_wolf_life - 大前端领航者
那么多选择器 可以试一下nth-of-type()