style h1 类选择器 大括号前面选择标签
h1 {
color: brown;
font-size: 40px;
字体大小
width: 500px;
宽度大小
height: 800px;
高度大小
background-color: blue;
}
/style
h1 class="f1" 4444444 /h1
br style .f1 { color: blueviolet;
font-size: 80px;
width: 500px;
height: 400px;
background-color: rgb(11, 54, 39);
}
/style
style .f1:hover {
background-color: rgb(200, 26, 76);
}
/* hover在鼠标划过时改变的样态在.f1后面加:hover */
/* :active点击 */
/* :focus获得焦点 *//style
body div
div
<!-- 盒模型以内容为主,内容设定的宽高是固定不变的 -->
<!-- 边框盒子是要加上边框 -->
<h1>h1</h1>
/div
<!-- alt+shift+f可以让代码更加整齐 -->
/div
<!-- css让页面美观一致 -->
h2 style="color: blue;height: 800px;font-size: 700px;background-color: chocolate;">h2</h2>/body