CSS學習-網頁導航欄

用ul製作網頁導航欄

<!DOCTYPE html>
<html>

	<head>
		<style>
			ul {
				list-style-type: none;
				margin: 0;
				padding: 0;
				width: 800px;
				overflow: hidden;
			}
			li {
				float: left;
			}
			a {
				display: block;
				width: 120px;
				font-weight: bold;
				color: #FFFFFF;
				border-right: 1px solid white;
				text-align: center;
				padding: 4px;
				text-decoration: none;
				text-transform: uppercase;
			}
			a:link,
			a:visited {
				background-color: #bebebe;
			}
			a:hover,
			a:active {
				background-color: #cc0000;
			}
		</style>
	</head>

	<body>
		<ul>
			<li><a href="#home">Home</a>
			</li>
			<li><a href="#news">News</a>
			</li>
			<li><a href="#contact">Contact</a>
			</li>
			<li><a href="#about">About</a>
			</li>
		</ul>
	</body>

</html>


效果如圖



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章