CSS帮助需要,我需要堆叠圆形divs彼此 [英] CSS help needed, I need to stack circular divs under each other

查看:120
本文介绍了CSS帮助需要,我需要堆叠圆形divs彼此的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个圆形div与一些css,使其扩展在鼠标。我不知道如何开始制作另一个更大的圆圈坐在它的后面有相同的中心点。这可能会在第一个圈子周围创建圈子。

I have a circular div with a some css that makes it expand on mousover. I have no idea on how to start about making another bigger circle sit behind it with the same center point. This could create a ring around the first circle.

例如。每个绿色圆圈代表下一个圆圈的外侧(共3个圆圈)

e.g. with each green ring representing the outside of the next circle (3 circles in total)

图片示例

我不认为我解释得很好! :/对不起!

I don't think i explained it very well! :/ Sorry! I need separate divs, not one that makes a outer ring!

这是我当前的代码:

#circles
{
margin-right:auto;
margin-left:auto;
width:800px;
height:800px;
alignment-adjust:central;
}

.circle1
{position:relative;

margin-top:50%;
margin-right:auto;
margin-left:auto;
width:100px;
height:100px;
border-radius:50%;
background: #ff3019; /* Old browsers */
background: -moz-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff3019), color-stop(100%,#cf0404)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* IE10+ */
background: linear-gradient(to bottom, #ff3019 0%,#cf0404 100%); /* W3C */  

transition:1s;
-moz-transition: 1s; /* Firefox 4 */
-webkit-transition: 1s; /* Safari and Chrome */
-o-transition: 1s; /* Opera */
-ms-transition: 1s; /* IE9 (maybe) */

}


推荐答案

这是否意味着你希望他们在悬停时成长,就像水中的圈子?
http://jsfiddle.net/GCyrillus/jGtAv/1

do you mean that you want them to grow on hover , like circles in water ? http://jsfiddle.net/GCyrillus/jGtAv/1

嵌套的div与内边距。

nested div with padding should do it or span .

div {
    min-height:1em;
    min-width:1em;
    margin:0;
    box-shadow:inset 0 0 0 1px;
    border-radius:100%;
    transition:1s;
    display:inline-block;
    vertical-align:top;
    text-align:center;line-height:0.8em;text-shadow:0 0 5px
}
div:hover, div:hover div {
    padding:3em;
    transition:1s;
}





   <div id="ring" title="rings in water"">
        <div>
            <div>
                <div>
                    <div>
                        <div>
                            <div>
                                <div id="stone"> o </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

这篇关于CSS帮助需要,我需要堆叠圆形divs彼此的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆