我是新來的CSS和試圖學習定位。我已經設置了以下樣式:如何使.left類出現在標題下方,但將標題位置保持固定?
div{
border-radius: 5px;
border: 1px solid black;
}
#header{
width: 550px;
position: fixed;
background-color: #e8e8e8;
height: 100px;
z-index: 1;
}
.left{
float: left;
display: inline-block;
position: relative;
background-color: #000000;
height: 300px;
width:275px;
}
.right{
float: right;
background-color: #0000ff;
width: 275px;
height: 300px;
}
#footer{
clear: both;
background-color: orange;
width: 550px;
height: 50px;
}
下面是HTML:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title></title>
</head>
<body>
<div id="header"></div>
<div class="left"></div>
<div class="right"></div>
<div id="footer"></div>
</body>
</html>
是否有即拍即。左類的頭選項卡的配合固定的定位做出現在非常頂級。如何讓.left類出現在標題下方,但將標題位置固定?
謝謝
將位置更改爲固定? http://jsfiddle.net/3fC5b/1/ –