css行內樣式
<html>
<head>
<title>測試css行內樣式</title>
</head>
<body>
<div id="test" style="height:300;width:300;background-color:#35f">行內樣式<div>
</body>
</html>
css內部樣式
<html>
<head>
<title>測試css內部樣式</title>
<style type="text/css">
#test{
height:300px;
width:500px;
background-image:url(picture/p2.jpg);
font-size:30px;
text-align:center;
line-height:50px;
}
</style>
</head>
<body>
<div id="test">內部樣式<div>
</body>
</html>
css外部樣式
#test{
height:300px;
width:500px;
background-image:url(../picture/p2.jpg);
font-size:30px;
text-align:center;
line-height:50px;
margin-top:0px;
margin-bottom=0px;
margin-left:auto;
margin-right:auto;
}
<html>
<head>
<title>測試css外部樣式</title>
<link href="css/wh.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="test">外部樣式<div>
</body>
</html>