我的問題是,如果有人能夠幫助我在「settings-div」下定位「container-div」。即使有人會放大,我也希望這會保持在「settings-div」之下。將div放在另一個div下
HTML:
<body>
<div class="menu">
<div class="option">Home</div>
<div class="option">Media</div>
<div class="option">link 3</div>
<div class="option">link 4</div>
<div class="option">link 5</div>
<div class="open"></div>
<div class="option" id="settings">Settings</div>
</div>
<div id="container">
<div class="s-o">Account</div>
<div class="s-o">Privacy</div>
<div class="s-o">Logout</div>
</div>
</body>
CSS:
html {
background-image: url("carbon_background.jpg");
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cgoogleover;
}
body, html {
height: 100%;
width: 100%;
padding: 0;
}
.menu {
margin-top: 0px;
height: 25px;
background-color: #3B5998;
margin-left: 0px;
margin-right: 0px;
border-radius: 0px;
margin-top: 0px;
width: 100%;
display: block;
top: 0px;
left: 0px;
margin-top: -8px;
margin-left: -8px;
}
.menu .option {
float: left;
width: 15%;
text-align: center;
background-color: #3B5998;
height: 25px;
border-radius: 0px;
color: white;
font-size: 20px;
text-decoration: none;
list-style-type: none;
}
.menu .open {
float: left;
width: 10%;
text-align: center;
background-color: #3B5998;
height: 25px;
border-radius: 0px;
text-decoration: none;
list-style-type: none;
}
.s-o {
list-style-type: none;
color: white;
margin-left: 85%;
background-color: #BBBBFF;
opacity: 0;
width: 15%;
margin-top: 0px;
text-align: center;
font-size: 20px;
}
Here is a jsFiddle of my current script。
你遇到了什麼問題,你試圖做到這一點? –
無論何時我放大,它會移動到右邊,或者它的3個div移動到另一個。 –