<p style="font-size: unset;color: chartreuse">python</p><!--元素内嵌样式表-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css创建</title>
<style type="text/css"> /*文档内嵌样式表*/
p{
font-size: revert;
color: #ff4400;
}
</style>
</head>
<body>
<p>python</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css创建</title>
<link rel="stylesheet" type="text/css" href="外部样式表.css"><!--引入外部样式表-->
</head>
<body>
<p>python</p>
</body>
</html>
css选择器:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css创建</title>
<style type="text/css">
.class1{
border-width: 10px;
border-color: chartreuse;
border-style: solid;/*solid实线*//*dashed破折线*//*dotted小圆点*/
padding: 20px;
margin: 40px;
}
</style>
</head>
<body>
<p class="class1">python</p>
<br>
<br>
<a href="http://www.baidu.com">百度</a>
</body>
</html>
<style type="text/css">
.class1{
padding: 20px;
border-width: 10px;
margin: 40px;
border-top-color: chartreuse;/*上边框颜色*/
border-left-color: #ff4400;/*左边框颜色*/
border-right-color: #ff4400;/*右边框颜色*/
border-bottom-color: #ff4400;/*下边框颜色*/
border-style: solid;/*solid实线*//*dashed破折线*//*dotted小圆点*/
border-top-style: dotted;/*上边框样式*/
border-bottom-style: dashed;/*下边框样式*/
border-left-style: dashed;/*上边框样式*/
border-right-style: revert;/*右边框样式*/
}
</style>
<style type="text/css">
.class1{
color: #ff4400;
width: 1024px;
height: 723px;
background-color: blue;/*背景颜色*/
background-image: url("timg.jpg");/*背景图片*/
background-repeat: no-repeat;/*背景图片只出现一次*/
background-size:cover;/*背景覆盖整个页面,自适应缩放*/
background-attachment: fixed;/*背景固定,滚动混轮,图片不动*/
background-attachment: local;/*滚动混轮,图片也动*/
}
</style>