这样做对吗?请老师详解
来源:2-8 编程练习
慕侠0038522
2018-09-08 14:55:50
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>属性选择器</title>
<style type="text/css">
div[class]{color:red;
background-color:yellow;
}
</style>
</head>
<body>
<div class="name">name</div>
<div class="pwd">pwd</div>
</body>
</html>
2回答
Miss路
2018-09-09
第二次修改的是对的,继续加油!欢迎采纳!
慕侠0038522
提问者
2018-09-08
我写错了是这样的老师
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>属性选择器</title>
<style type="text/css">
div[class]{color:red;
}
div[class="pwd"]{
background-color:yellow;
}
</style>
</head>
<body>
<div class="name">name</div>
<div class="pwd">pwd</div>
</body>
</html>
相似问题