div+css绝对和相对定位有哪位给出说解

来源:百度知道 编辑:UC知道 时间:2024/06/14 18:48:28
我想知道DIV+CSS的相对定位和绝对定位,有哪位给出好的实例并讲解一下,谢谢了!

meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>相对定位和绝对定位实例--作者:唐国辉</title>
<style type="text/css">
<!--
*{
margin:0px;
padding:0px;
}
body {
margin:10px;
font-size: 13px;
}
a:link {
color: #666;
text-decoration: none;/*去除链接下划线*/
}
a:visited {
color: #666;
text-decoration: none;
}
a:hover {
color: #F90;
}
h3 {
color: #FFF;
background-color: #F90;
width: 100px;
padding-top:3px;
text-align:center;
}
ul {
width: 300px;
border-top: 1px solid #F60;/*使其上边有一线条,与标题h3吻合*/
}
ul li {
padding:5px;
border-bottom: 1px solid #CCC;
list-style:none;/*去除列表样式,这对于标准浏览很重要*/
}
a {
position: relative;/*设置其定位方法为相对定位,等一下内部信息面板就可以相对它定位*/
display:block;/*让链接以块状呈现,这样不用点中链接文字就可以响应链接*/
}
a div {
display: none;/*初始化