我是一個新手的CSS分開,也許你笑我的問題......CSS - 股利不遠離另一個DIV
我有2倍主要的DIV(「topinfo」和「NAVIGAT」),我需要他們一個接一個地保持分離,但由於某種原因他們沒有。在小提琴
運行代碼:https://jsfiddle.net/7mgfrhq6/
下面是HTML代碼:
<div id="topinfo">
<div id="infowin">
<div id="computer">
<b>Computer:</b> 123456789(192.168.560.000)
<img src="http://i.imgur.com/Y1CJmSa.png" id="more"/>
</div>
</div>
<div id="statbtn">
<a href="stats.htm" target="_blank">
<img src="http://i.imgur.com/rh4XEOQ.png" id="bstats">
</a>
</div>
</div>
<div class="navigat">
<a href="" class="navbtn">« First</a>
<a href="" class="navbtn">« Prior</a>
<select class="navsel" onchange="self.location.href=options[selectedIndex].value">
<option selected="selected">Page 001</option>
<option value="pag002.htm">Page 002</option>
<option value="pag003.htm">Page 003</option>
<option value="pag004.htm">Page 004</option>
<option value="pag005.htm">Page 005</option>
</select>
<a href="" class="navbtn">Next »</a>
<a href="" class="navbtn">Last »</a>
</div>
這裏是CSS代碼:
#topinfo {
width: 420px;
margin: 16px auto 4px auto;
}
#topinfo #infowin {
float: left;
width: 380px;
border: 1px dotted #292929;
border-radius: 4px;
background-color: #FFFFE8;
}
#topinfo #infowin #computer {
padding: 6px;
font-family: Verdana, Tahoma, Helvetica;
font-size: 10pt;
text-align: center;
}
#topinfo #statbtn {
float: right;
width:32px;
height:32px;
border: 0;
}
.navigat {
width: 600px;
margin: 18px auto 14px auto;
font-family: Tahoma, Verdana, Helvetica;
text-align: center;
}
.navigat a.navbtn {
display: inline-block;
width:70px;
padding: 3px 3px 4px 3px;
margin: 3px;
font-size: 9pt;
color: #FFFFFF;
text-align: center;
text-decoration: none;
background-color: #1D63C8;
border-radius: 10px;
cursor: pointer;
}
.navigat select.navsel {
display: inline-block;
width:100px;
padding:3px;
margin: 3px;
font-size: 9pt;
line-height: 1;
cursor: pointer;
}
這裏是我的了:
這裏是我真正需要的:
感謝您的幫助!
謝謝你的詳細解答! – Guybrush