gpt4 book ai didi

html - CSS – 悬停在圆形图像上后修复边缘

转载 作者:太空宇宙 更新时间:2023-11-04 02:59:52 26 4
gpt4 key购买 nike

我创建了 div 元素,我还添加了一个 border-radius 属性,使 div 更美观。我还向 div 添加了一个 -webkit-transition: opacity .25s ease 属性,以便在用户将鼠标悬停在 div< 上时创建到深色叠加层的过渡。然后,我遇到了一个可以用这些图像解释的问题。

div 元素外的光标:

enter image description here

将光标移动到 div 元素内: enter image description here

光标完全位于 div 元素内: enter image description here

所以,我想这是过渡的问题,它是由图像的圆形边框引起的。这有点烦人,我想删除它,但我不知道该怎么做。我在这里附上了代码:

注意:.memX(其中 X 是一个数字)指的是每个 div 元素。大约有 10 个 .mem 元素。

mem1, .mem2, .mem3, .mem4, .mem5, .mem6, .mem7, .mem8, .mem9, .mem10 {
height: 200px;
width: 200px;
margin: 0px 31px;
display: inline-block;
border-radius: 10px;
border: solid;
border-width: thin;
border-color: #d6d6d6;
overflow: hidden;
}

.overlay {
background: rgba(0,0,0,.4);
text-align: center;
height: 100px;
width: 100%;
padding: 45px 0px 66px 0px;
opacity: 0;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease;
}

.insidetext {
font-family: "Source Sans Pro", Helvetica, Arial, sans-serif;
font-weight: lighter;
color: rgba(255,255,255,.85);
font-size: 1.5em;
margin-top: 35px;
}

.mem1:hover .overlay, .mem2:hover .overlay, .mem3:hover .overlay, .mem4:hover .overlay, .mem5:hover .overlay, .mem6:hover .overlay, .mem7:hover .overlay, .mem8:hover .overlay, .mem9:hover .overlay {
border-radius: 10px;
opacity: 1;
}

.mem1 {
background-image: url(members/giles.png);
}

这似乎是一个普遍的问题。你可以在这个 CodePen 上看到这个特殊的问题:http://codepen.io/ianfarb/pen/ikeAf

最佳答案

尝试使用这个..

body {
background: #e7e7e7;
}

#box {
width: 300px;
height: 200px;
box-shadow: inset 1px 1px 40px 0 rgba(0, 0, 0, .45);
border-bottom: 2px solid #fff;
border-right: 2px solid #fff;
margin: 5% auto 0 auto;
background: url(http://ianfarb.com/wp-content/uploads/2013/10/nicholas-hodag.jpg);
background-size: cover;
border-radius: 5px;
overflow: hidden;
position: relative;
}

#overlay {
background: rgba(0, 0, 0, .75);
text-align: center;
/*padding: 45px 0 66px 0;*/
display: table;
width: 100%;
height: 100%;
opacity: 0;
border-radius: 5px;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease;
}

#box:hover #overlay {
opacity: 1;
}

#plus {
font-family: Helvetica;
font-weight: 900;
color: rgba(255, 255, 255, .85);
font-size: 96px;
display: table-cell;
vertical-align: middle;
}

http://codepen.io/anon/pen/VLBqvE

关于html - CSS – 悬停在圆形图像上后修复边缘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31503494/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com