CSS基础(一)
1. 行内使用
直接在 html标记后增加 ,只影响这一个html标记内
<body style="color:red;font-size: 100" >
</body>
2. 对某一种html标记做用,不需要单独引用
在这个html里,所有这类标记都会受到影响(只要没有级别更高的css)。在 html里不需要再单独引用。
<style>p{
color: blue
}
</style>
3. 对某一类标记使用,需要单独引用
定义:自行定义类名,以“.”开头
使用:class:类名
<style>.one{color:red;}
</style>
<p class="one" >aaa</p>
4. 单独ID,只能用一次
只能用一次。因为html中的id不允许重复
定义:以“#”开头,名 字用html标记中的 ID
使用:html中已有id
<style> #id1{color: navy;font-size: 30;
}
</style>
<p id="id1" >aaa</p>

被折叠的 条评论
为什么被折叠?



