2017-05-27 140 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