我有一些类似 Google+ 的圈子,但我似乎无法让该overflow
物业与他们合作。我认为这与z-index
圆圈的属性有关,尽管我尝试将z-index
div 设置为覆盖它而没有运气。
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;
}