Home > Software engineering >  How to center download button and reduce the size?
How to center download button and reduce the size?

Time:12-24

How to center a button and make it smaller than shown in the image?

HTML:

<a href="SUJITBANNE.pdf" download="SUJITBANNE" >Download CV</a>

CSS-

.cv {
  position: relative;
  background: #080808;
  display: inline-block;
  color: #fff;
  padding: 10px 30px;
  font-size: 18px;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 2px;
  font-weight: 500;
  text-align: center;
  width: 100%;
  margin-bottom: 30px;
}

CodePudding user response:

Here you Go

    .cv {
      position: relative;
      background: #080808;
      display: inline-block;
      color: #fff;
      padding: 10px 30px;
      font-size: 18px;
      text-transform: uppercase;
      text-decoration: none;
      letter-spacing: 2px;
      font-weight: 500;
      text-align: center;
      width: 30%;
      margin-bottom: 30px;
    }
    div{
    display: flex;
    justify-content: center;
    align-items: center;
    }
<div>
   <a href="SUJITBANNE.pdf" download="SUJITBANNE" >Download CV</a>
</div>

CodePudding user response:

change the display property to flex and add a new property called justify-content with the value of center. This should work

  • Related