css
CSS(Cascading Style Sheets) 层叠样式表、CSS样式表、样式表 后缀 .css
selector{property:value} 选择符{属性:属性值}
selector{property1:value;property2:value;property3:value;……}
p{font-family:"隶书";color:red;font-size:40px;font-weight:bold}
Dreamweaver
Dream 梦想 weaver 编制者
CSS的使用方式
1、行内样式
<p style="color:red">段落样式</p>
2、内嵌样式
<head>
<style type="text/css">
p{color:green;
font-size:12px;
}
</style>
</head>
3、链接样式
<link href="3.5.css" type="text/css" rel="stylesheet" />
@charset "utf-8";
/* CSS Document */
p{color:blue;font-size:12px;font-style:italic;}
4、导入样式
<head>
<style type="text/css">
@import "1.css";
</style>
</head>
与行内样式冲突不知如何处理?
优先级
行内样式 > 内嵌样式 > 链接样式 > 导入样式
CSS(Cascading Style Sheets) 层叠样式表、CSS样式表、样式表 后缀 .css
selector{property:value} 选择符{属性:属性值}
selector{property1:value;property2:value;property3:value;……}
p{font-family:"隶书";color:red;font-size:40px;font-weight:bold}
Dreamweaver
Dream 梦想 weaver 编制者
CSS的使用方式
1、行内样式
<p style="color:red">段落样式</p>
2、内嵌样式
<head>
<style type="text/css">
p{color:green;
font-size:12px;
}
</style>
</head>
3、链接样式
<link href="3.5.css" type="text/css" rel="stylesheet" />
@charset "utf-8";
/* CSS Document */
p{color:blue;font-size:12px;font-style:italic;}
4、导入样式
<head>
<style type="text/css">
@import "1.css";
</style>
</head>
与行内样式冲突不知如何处理?
优先级
行内样式 > 内嵌样式 > 链接样式 > 导入样式