Circle button css

后端 未结 9 780
忘了有多久
忘了有多久 2020-12-13 06:00

I\'m a beginner and very confused, as a div tag when I give the same width and height with border-radius: 50% it always becomes circle. but with the tag a in case I want to

9条回答
  •  暖寄归人
    2020-12-13 06:48

    Here is a flat design circle button:

    .btn {
      height: 80px;
      line-height: 80px;  
      width: 80px;  
      font-size: 2em;
      font-weight: bold;
      border-radius: 50%;
      background-color: #4CAF50;
      color: white;
      text-align: center;
      cursor: pointer;
    }
    +

    but the problem is that the + might not be perfectly centered vertically in all browsers / platforms, because of font differences... see also this question (and its answer): Vertical alignement of span inside a div when the font-size is big

提交回复
热议问题