Responsive transparent overlapping css circles with text align vertical and center

后端 未结 2 1626
礼貌的吻别
礼貌的吻别 2021-01-21 18:19

Can\'t seem to get my text to align center and vertical within each circle. Tried putting h1 text inside of another div - display table, but having problems containing text insi

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 18:42

    Something like this.. first add a circle class

      

    Two lines
    &Two lines

    etc.

    then set a height on the containing element

    #circle-wrapper{
        position:relative;
        top:0;
        left:0; 
        height: 1200px;
    }
    

    and also on .circle and h1...

    .circle, h1 {
      display: table-cell;
      vertical-align: middle;
      text-align: center;
      height: 400px;
      width: 400px;
    }
    

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

提交回复
热议问题