0
我終於通過使用絕對位置獲得了我的標識,但現在我的「某些鏈接」不可點擊。我試圖添加z-index到menu_small div,但它沒有幫助。如何使鏈接點擊與絕對位置?
<div id="menu">
<div id="logo"><a class="logo" href="index.php"> THIS IS A SITE! </a></div>
<div id="menu_small" href="xxxxx.php" style="margin-right: 10%; float: right;">Some link 1</div>
<div id="menu_small" href="xxxx.php" style="margin-left: 10%; float: left;">Some link 2</div>
</div>
CSS:
#menu{
width: 100%;
height: 90px;
float: left;
background: rgb(255, 255, 255);
background: rgba(255, 255, 255, .82);
margin-right: 60px;
z-index: 1; }
#menu_small{
margin-top: 37px;
font-size: 18pt;
z-index:30; }
#logo{
width: 100%;
height: auto;
position: absolute;
font-size: 38pt;
line-height: 90px;
text-align: center;
z-index: 2; }
.logo{
width: auto;
height: auto; }
嘗試設置絕對的DIV ID位置:標誌 – Anton 2014-12-06 16:29:00
鏈接的作品對我來說http://jsfiddle.net/j08691/2yna7d8s/light/。順便說一下,'z-index'只適用於定位元素,所以'#menu_small'中的規則不會做任何事情。另外,ID **必須是唯一的。 – j08691 2014-12-06 16:35:06
Anton,div id:logo已經有位置絕對? j08691,我不能點擊你鏈接的jsfiddle中的「某個鏈接1」或「某個鏈接2」。它對你有用嗎?感謝關於z-index的提示! – user3551404 2014-12-06 16:54:53