今天依旧贴代码,一个简单的商品促销的网页:
<title>商品推销页面</title>
</head>
<style type="text/css">
body{background-color:#FFFF66}
h1{font-family:"新宋体";
font-size:60px;
color:#3333FF;
font-style:oblique;
font-weight:bolder;
text-align:center}
h2{font-family:"新宋体";
font-size:36px;
color:#CC00CC;
font-style:oblique;
font-weight:bolder;
text-align:right
}
h3{font-family:"新宋体";
font-size:28px;
color:#00CC99;
font-style:oblique;
font-weight:bolder;
text-align:right
}
.n{text-align:center;
font-size:23px;
color:#FF00FF;}
.m{text-align:right;
font-size:26px}
a:link{color:#000000;
text-decoration:underline}
a:visited{
color:#0033FF;
text-decoration:none}
a:hover{color:#33FF33;
text-decoration:none}
a:active{color:black;
text-decoration:none}
</style>
<body>
<h1>可爱小熊包包促销</h1>
<h2>发布时间:2015年10月30日</h2>
<h3>特价促销:39.9</h3>
<p class="n">毛茸茸的外表</p>
<p class="n">超温暖的内心</p>
<p class="n">萌萌哒的小熊</p>
<p class="n">多方式的背法</p>
<div align="center"><img src="萌萌哒.jpg" width="600" height="450"></div>
<a href=" " class="m">15079137271</a>
</body>
</html>
本章代码主要是运用CSS样式,给商品促销页面中各个不同的文字设置不同的样式,包含文字颜色、样式、字体、字号,以及下划线和浮动效果等。达到了一个简单的页面效果,如图所示: