方法一、直接设置(不推荐)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>测试css</title>
给标签设置css样式
<style type="text/css">
div{
border:1px solid ;
}
span{
border:1px solid ;
}
</style>
</head>
<body>
<!-- 在标签的style属性上设计-->
<div >
aeefasfsf
</div>
<span>
daffasfa
</span>
<p id="idname">edfsdfdfsf</p>
<p id="id01">edfsdfdfsf</p>
<p class="class1">qwwqwd</p>
</body>
</html>
方法二、引入css样式(推荐)
1.css
div{
border:1px solid #ff0000;
}
span{
border:1px solid #ff0000;
}
#idname {
border:2px solid #075a5a;
}
.class1{
border:3px solid #e5e565;
}
#id01,.class1{
border:3px solid #d0d042;
}
2 four.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>测试css</title>
k rel="stylesheet" type="text/css" href="../css/1.css"/>
</head>
<body>
<!-- 在标签的style属性上设计-->
<div >
aeefasfsf
</div>
<span>
daffasfa
</span>
<p id="idname">edfsdfdfsf</p>
<p id="id01">edfsdfdfsf</p>
<p class="class1">qwwqwd</p>
</body>
</html>
``