gpt4 book ai didi

html - google+ circle css 溢出与 z-index

转载 作者:太空宇宙 更新时间:2023-11-04 15:46:00 25 4
gpt4 key购买 nike

我有一些类似于 Google+ 的圈子,但我似乎无法使用 overflow 属性来处理它们。我认为它与圆圈的 z-index 属性有关,尽管我已经尝试设置 div 的 z-index 来覆盖它但没有运气.

jsFiddle

HTML:

<div class="container">
<div class="circle">
<div class="outer-circle"></div>
<div class="middle-circle"></div>
<div class="inner-circle">4</div>
</div>
<div class="circle">
<div class="outer-circle"></div>
<div class="middle-circle"></div>
<div class="inner-circle">3</div>
</div>
<div class="circle">
<div class="outer-circle"></div>
<div class="middle-circle"></div>
<div class="inner-circle">2</div>
</div>
<div class="circle">
<div class="outer-circle"></div>
<div class="middle-circle"></div>
<div class="inner-circle">1</div>
</div>
</div>​

CSS:

div.container {
height: 125px;
width: 400px;
overflow: scroll;
border: 1px solid black;
}
div.circle {
margin-left: 10px;
margin-right: 10px;
width: 130px;
height: 130px;
float: left;
}
div.circle:hover {
cursor: pointer;
}
div.outer-circle {
background: transparent;
width: 122px;
height: 122px;
-webkit-border-radius: 61px;
-moz-border-radius: 61px;
border-radius: 61px;
border: 1px solid #aaaaaa;
position: absolute;
z-index: 800;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
div.outer-circle.hover {
-moz-transform: scale(1.45);
-webkit-transform: scale(1.45);
transform: scale(1.45);
}
div.middle-circle {
margin: 1px;
width: 122px;
height: 122px;
-webkit-border-radius: 61px;
-moz-border-radius: 61px;
border-radius: 61px;
background: #ececec;
background: -moz-linear-gradient(top, #ececec 0%, #d8d8d8 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ececec), color-stop(100%,#d8d8d8)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ececec 0%,#d8d8d8 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ececec 0%,#d8d8d8 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ececec 0%,#d8d8d8 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ececec', endColorstr='#d8d8d8',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #ececec 0%,#d8d8d8 100%); /* W3C */
position: absolute;
z-index: 900;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
div.middle-circle.hover {
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
}
div.inner-circle {
margin: 14px;
background: #3C4049;
width: 96px;
height: 96px;
font-size: 11px;
color: #FFF;
line-height: 96px;
text-align: center;
font-family: Arial;
-webkit-border-radius: 48px;
-moz-border-radius: 48px;
border-radius: 48px;
-webkit-box-shadow: inset 0px 1px 1px 0px #575757;
-moz-box-shadow: inset 0px 1px 1px 0px #575757;
box-shadow: inset 0px 1px 1px 0px #575757;
border-bottom: 1px solid #FFF;
position: absolute;
z-index: 1000;
}

最佳答案

试试这个:

div.container {
height: 125px;
width: 400px;
overflow: auto;
border: 1px solid black;
position: relative;
}
div.circle {
margin-left: 10px;
margin-right: 10px;
width: 130px;
height: 130px;
float: left;
position: relative;
}

现场演示:jsFiddle

关于html - google+ circle css 溢出与 z-index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11744578/

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