2017-05-27 125 views
1

所以我剛開始學習HTML/CSS,我試圖創建一個雜誌,我組建了一個網站。然而,當我嘗試添加兩個鏈接到兩個不同的片文字,一個是隻有部分可點擊和下面的一個不是。超鏈接只是部分可點擊

我認爲它與我的包裝或我在文本旁邊的照片有關,因爲當我將它們對齊更正確時,它們現在可點擊。好像是喜歡的東西擋住了字(鏈接)的一部分被點擊。

我試圖做一個工具,而不是,但我仍然得到同樣的結果。我想走動我的代碼用於不同的結果,但仍然無法搞清楚。

#wrapper { 
 
    margin: 0 auto; 
 
    width: 1140px; 
 
} 
 

 
.slider { 
 
    max-width: 457px; 
 
    height: 451px; 
 
    margin: 0 auto; 
 
    position: relative; 
 
} 
 

 
.slide1, 
 
.slide2, 
 
.slide3, 
 
.slide4, 
 
.slide5 { 
 
    position: absolute; 
 
    width: 100%; 
 
    height: 100%; 
 
} 
 

 
.slide1 { 
 
    background: url(TPWeb.jpg)no-repeat center; 
 
    background-size: cover; 
 
    animation: fade 80s infinite; 
 
    -webkit-animation: fade 20s infinite; 
 
    margin-top: 20px; 
 
    margin-left: -155px; 
 
} 
 

 
.slide2 { 
 
    background: url(DS.jpg)no-repeat center; 
 
    background-size: cover; 
 
    animation: fade2 80s infinite; 
 
    -webkit-animation: fade2 20s infinite; 
 
    margin-top: 20px; 
 
    margin-left: -155px; 
 
} 
 

 
.slide3 { 
 
    background: url(IT95Web.jpg)no-repeat center; 
 
    background-size: cover; 
 
    animation: fade3 80s infinite; 
 
    -webkit-animation: fade3 20s infinite; 
 
    margin-top: 20px; 
 
    margin-left: -155px; 
 
} 
 

 
@font-face { 
 
    font-family: 
 
} 
 

 
@keyframes fade1 { 
 
    0% { 
 
    opacity: 1 
 
    } 
 
    33.333% { 
 
    opacity: 0 
 
    } 
 
    66.666% { 
 
    opacity: 0 
 
    } 
 
    100% { 
 
    opacity: 1 
 
    } 
 
} 
 

 
@keyframes fade2 { 
 
    0% { 
 
    opacity: 0 
 
    } 
 
    33.333% { 
 
    opacity: 1 
 
    } 
 
    66.666% { 
 
    opacity: 0 
 
    } 
 
    100% { 
 
    opacity: 0 
 
    } 
 
} 
 

 
@keyframes fade3 { 
 
    0% { 
 
    opacity: 0 
 
    } 
 
    33.333% { 
 
    opacity: 0 
 
    } 
 
    66.666% { 
 
    opacity: 1 
 
    } 
 
    100% { 
 
    opacity: 0 
 
    } 
 
} 
 

 

 
} 
 
.TPWeb { 
 
    margin-top: 80px; 
 
    margin-left: 50px; 
 
} 
 
.DFBase1 { 
 
    margin-top: 45px; 
 
    margin-left: 183px; 
 
    width: 448px; 
 
    height: 127px; 
 
} 
 
.ATA { 
 
    margin-right: 305px; 
 
    margin-top: -475px; 
 
    font-family: 
 
} 
 
.B { 
 
    margin-right: 370px; 
 
    font-family: 
 
} 
 
.about { 
 
    color: #000; 
 
    text-decoration: none; 
 
} 
 
.blog { 
 
    color: #000; 
 
    text-decoration: none; 
 
}
<div id="wrapper"> 
 

 
    <div class='slider'> 
 
    <div class='slide1'></div> 
 
    <div class='slide2'></div> 
 
    <div class='slide3'></div> 
 
    </div> 
 

 
    <img src="DFBase1.png" alt="DFBase" class=DFBase1> 
 

 
    <div align="right" class=ATA> 
 
    <font size="5"><em><b><a href="http://google.com" title="about the author" class="about" target="new">about the author</a></b></em></font> 
 
    </div> 
 

 
    <div align="right" class=B> 
 
    <font size="5"><em><b><a href="http://google.com" title="blog" class="blog" target="new">blog</a></b></em></font> 
 
    </div> 
 
</div>

回答

0

.slider是因爲您使用的是負margin移動回鏈接在頁面上重疊的鏈接。

一個簡單的修正是通過分配position: relative

.ATA, .B { 
 
position: relative; 
 
    } 
 

 
#wrapper { 
 
    margin: 0 auto; 
 
    width: 1140px; 
 
} 
 

 
.slider { 
 
    max-width: 457px; 
 
    height: 451px; 
 
    margin: 0 auto; 
 
    position: relative; 
 
} 
 

 
.slide1, 
 
.slide2, 
 
.slide3, 
 
.slide4, 
 
.slide5 { 
 
    position: absolute; 
 
    width: 100%; 
 
    height: 100%; 
 
} 
 

 
.slide1 { 
 
    background: url(TPWeb.jpg)no-repeat center; 
 
    background-size: cover; 
 
    animation: fade 80s infinite; 
 
    -webkit-animation: fade 20s infinite; 
 
    margin-top: 20px; 
 
    margin-left: -155px; 
 
} 
 

 
.slide2 { 
 
    background: url(DS.jpg)no-repeat center; 
 
    background-size: cover; 
 
    animation: fade2 80s infinite; 
 
    -webkit-animation: fade2 20s infinite; 
 
    margin-top: 20px; 
 
    margin-left: -155px; 
 
} 
 

 
.slide3 { 
 
    background: url(IT95Web.jpg)no-repeat center; 
 
    background-size: cover; 
 
    animation: fade3 80s infinite; 
 
    -webkit-animation: fade3 20s infinite; 
 
    margin-top: 20px; 
 
    margin-left: -155px; 
 
} 
 

 
@font-face { 
 
    font-family: 
 
} 
 

 
@keyframes fade1 { 
 
    0% { 
 
    opacity: 1 
 
    } 
 
    33.333% { 
 
    opacity: 0 
 
    } 
 
    66.666% { 
 
    opacity: 0 
 
    } 
 
    100% { 
 
    opacity: 1 
 
    } 
 
} 
 

 
@keyframes fade2 { 
 
    0% { 
 
    opacity: 0 
 
    } 
 
    33.333% { 
 
    opacity: 1 
 
    } 
 
    66.666% { 
 
    opacity: 0 
 
    } 
 
    100% { 
 
    opacity: 0 
 
    } 
 
} 
 

 
@keyframes fade3 { 
 
    0% { 
 
    opacity: 0 
 
    } 
 
    33.333% { 
 
    opacity: 0 
 
    } 
 
    66.666% { 
 
    opacity: 1 
 
    } 
 
    100% { 
 
    opacity: 0 
 
    } 
 
} 
 

 

 
} 
 
.TPWeb { 
 
    margin-top: 80px; 
 
    margin-left: 50px; 
 
} 
 
.DFBase1 { 
 
    margin-top: 45px; 
 
    margin-left: 183px; 
 
    width: 448px; 
 
    height: 127px; 
 
} 
 
.ATA { 
 
    margin-right: 305px; 
 
    margin-top: -475px; 
 
    font-family: 
 
} 
 
.B { 
 
    margin-right: 370px; 
 
    font-family: 
 
} 
 
.about { 
 
    color: #000; 
 
    text-decoration: none; 
 
} 
 
.blog { 
 
    color: #000; 
 
    text-decoration: none; 
 
}
<div id="wrapper"> 
 

 
    <div class='slider'> 
 
    <div class='slide1'></div> 
 
    <div class='slide2'></div> 
 
    <div class='slide3'></div> 
 
    </div> 
 

 
    <img src="DFBase1.png" alt="DFBase" class=DFBase1> 
 

 
    <div align="right" class=ATA> 
 
    <font size="5"><em><b><a href="http://google.com" title="about the author" class="about" target="new">about the author</a></b></em></font> 
 
    </div> 
 

 
    <div align="right" class=B> 
 
    <font size="5"><em><b><a href="http://google.com" title="blog" class="blog" target="new">blog</a></b></em></font> 
 
    </div> 
 
</div>

,得到一個鏈接 z-index