css中的三种选择器

时间:2026-02-15 01:07:24

1、新建文件创建标记选择器

css中的三种选择器

2、效果

css中的三种选择器

3、创建类别选择器

css中的三种选择器

4、效果

css中的三种选择器

5、创建ID选择器

css中的三种选择器

6、效果

css中的三种选择器

7、附上源码

<style>

h1{color:red;}

.class{width:100px; height:100px; background:#903; margin-top:20px;}

#id{width:100px; height:100px; background:#06F; margin-top:20px;}

</style>

<body>

<h1>标记选择器</h1>

<div class="class">类别选择器</div>

<div id="id">ID选择器</div>

</body>

css中的三种选择器

© 2026 途途旅游
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com