CSS概述

CSS全称为层叠样式表,它主要是用于定义HTML内容在浏览器内的显示样式,如文字大小、颜色、字体加粗等
p{
   font-size:12px;
   color:red;
   font-weight:bold;
}

CSS的注释是:/*注释语句*/

CSS有三种样式:

1 内联样式
<p style="color:red">这里文字是红色。</p>
2 嵌入式样式
<style type="text/css">
span{
color:red;
}
</style>
3 外部样式
<link href="base.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/page/skins/standard/css/main.css" rel="stylesheet" type="text/css" />
三种方法的优先级
内联式 > 嵌入式 > 外部式

猜你喜欢

转载自cfj.iteye.com/blog/2270430
今日推荐