How to make one circle inside of another using CSS

后端 未结 13 2317
-上瘾入骨i
-上瘾入骨i 2020-12-30 03:54

I am trying to make one circle inside of another circle using css, but I am having an issue making it completely centered. I am close, but still not there. Any ideas?

<
13条回答
  •  清酒与你
    2020-12-30 04:41

    SOLVED! Exactly the way you want:

    DEMO: http://jsfiddle.net/aniruddha153/RLWua/

    HTML:

    CSS:

    #content {
       position: relative;
       width: 100%;
       padding-bottom: 100%;
    }
    
    #outer-circle {
       position: absolute;
       width: 50%;
       height: 50%;
       background-color: #000000;
       border-radius: 50%;
    }
    
    #inner-circle{
      margin-top: 25%;
      margin-left: 25%;
      position: absolute;
      width: 50%;
      height: 50%;
      background-color: #e5e5e5;
      border-radius: 50%;
    }
    

提交回复
热议问题