更改<a> html标签的宽度

时间:2019-07-08 08:12:13

标签: html css

如何更改 a 标签的宽度?在CSS样式表中更改200px的宽度无效。将鼠标悬停在此图片上时,我必须将此标签用于可点击的图像。以下是一些详细信息:

每张图片的HTML代码:

<a href="/bialystok-housing">
       <div class="cover-wrapper">
            <img src="{% static'mainapp/projects/BIALYSTOK_HOUSING/bialystok_housing.jpg' %}">
            <h7>białystok housing</h7>
       </div>
</a>

CSS:

.cover-wrapper {
    position:relative;
    width:30%;
    overflow: hidden;
    margin-right:3%;
    display:inline-block;
    margin-top: 2%;
    height:250px;
    transition:.3s;
}

.cover-wrapper img {
    width: 100%;
    height: 100%;
    transition:.3s;
}

.cover-wrapper :not(img) {
    position:absolute;
    z-index:1;
    top:50%;
    width:100%;
    text-align:center;
    opacity:0;
    transition:.3s;
    color:black;
  }

.cover-wrapper:hover img{
    opacity: 0.2;
}

.cover-wrapper:hover :not(img){
    opacity:1;
}

issue

0 个答案:

没有答案