在WEB标准中,结构使用html、xml,表现使用CSS,行为使用JS。Cascading Style Sheets 层叠样式表,WEB标准中的表现标准语言,主要对网页信息显示进行控制,修饰网页信息的显示样式。2010年开始CSS3.0版本。
1 CSS样式
(1)内部样式
<style type="text/css">
p{ color: red; }
</style>
(2)外部样式
<link rel="stylesheet" type="text/css" href="css/style.css"/>
(3)内联样式
<p style="color: blue;">ln is a nice man</p>
2 导航条示例
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
li{
display: inline-block;
width: 100px;
height: 30px;
background-color: #ff0000;
font-size: 12px;
text-align: center;
line-height: 30px;
}
a{
color: #fff;
text-decoration: none;
}
</style>
</head>
<body>
<ul>
<li><a href="#">导航1</a></li>
<li><a href="#">导航2</a></li>
<li><a href="#">导航3</a></li>
<li><a href="#">导航4</a></li>
<li><a href="#">导航5</a></li>
<li><a href="#">导航6</a></li>
<li><a href="#">导航7</a></li>
<li><a href="#">导航8</a></li>
</ul>
</body>
</html>