CSS+DIV布局、导航链接基础1

该博客展示了使用HTML和CSS构建页面布局的示例。通过定义不同的div元素,如top、main、left等,并使用CSS设置其样式,包括背景颜色、尺寸、浮动等,实现了一个包含顶部、主体和侧边栏的页面布局,还设置了链接的样式。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
}
#top {
 background-color: #0099CC;
 height: 70px;
 width: 100%;
 border-bottom-width: 1px;
 border-bottom-style: dashed;
 border-bottom-color: #999999;
 font-size: 12px;
 color: #000000;
 text-decoration: none;
}
#left {
 background-color: #CCCCCC;
 margin-right: 80%;
 padding: 10px;
}
#main {
 background-color: #FFFFCC;
 float: right;
 width: 78%;
 padding: 10px;
 font-size: 12px;
 color: #000000;
 text-decoration: none;
 }
#sss ul a:link, #sss ul a:visited {display: block;}

#sss ul {
 list-style: none;
 margin: 0;
 padding: 0;
}

/* hack to fix IE/Win's broken rendering of block-level anchors in lists */
#sss li {
 border-bottom: 1px solid #666666;
 line-height: 2;
}

/* fix for browsers that don't need the hack */
html>body #sss li {border-bottom: none;}

#sss{
 margin: 0px;
 padding: 0px;
 font-size: 12px;
 background-color: #CCCCCC;
}
#sss a:link{
 padding: 2px 0px 2px 10px;
 width: 100%;
 width: auto;
 text-decoration: none;
 color: #000000;
}

#sss a:visited{
 padding: 2px 0px 2px 10px;
 text-decoration: none;
 color: #000000;
}

#sss a:hover{
 background-color: #F0F0F0;
 padding: 2px 0px 2px 10px;
 text-decoration: none;
 color: #FF0000;
}
-->
</style></head>

<body>
<div id="top">此处显示 class "top" 的内容</div>
<div id="main">此处显示 class "main" 的内容</div>
<div id="left">
   <div id="sss">
   <ul>
      <li><a href="#">***链接***</a></li>
      <li><a href="#">***链接***</a></li>
      <li><a href="#">***链接***</a></li>
      <li><a href="#">***链接***</a></li>
      <li><a href="#">***链接***</a></li>
      <li><a href="#">***链接***</a></li>
    </ul>
 </div>
</div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值