样式在哪写
<style>
</style>
定义一个区域<span></span>
<span class="note">海伦(BBC版)</span>
class="note"意思是定义类名称
完整标签样式代码
<style>
h1{
color: red;
font-size:30px;
text-decoration: underline
}
a{
color: blueviolet;
font-size: 20px;
}
h2{
text-align: center;
}
.time{
color: gray;
}
.note{
color: red;
}
.avatar{
border-radius: 50%;
}
.art-img{
width: 300px;
}
</style>
1.h1、a等属于类标签选择器
h1{
color: red;
font-size:30px;
text-decoration: underline
}
- .time、.note 等属于类选择器
.time{
color: gray;
}
3.图片的标签--可直接写死某张图片的大小,也可用标签通过类选择器统一大小
<img src="images/002.webp" alt="" width="200">
.art-img{
width: 300px;
}
<img class="art-img" src="images/002.webp" alt="" >
网友评论