0

I am trying to add a ghost button on a bootstrap carousel here: http://oarvoredo.businesscatalyst.com/

It's the first slide the white button.

.a_banner a {
    color:#FFF !important;
    font-size:22px !important;
    text-decoration:none;
    position:absolute;
    top: 75% !important;
    text-align:center;
    margin-left:40%;
    margin-right:40%;
    border:1px solid #FFF;
    border-radius:16px;
    padding-left:1%;
    padding-right:1%;
}

I am not being able to center it properly with position:absolute;. How can I make this work?

Miguel Mota
  • 20,135
  • 5
  • 45
  • 64

2 Answers2

0

Set left to 50% and margin-left to minus half of button width.

.a_banner a {
    display: inline-block;
    position: absolute;
    top: 75%;
    left: 50%;
    width: 200px;
    margin: 0 0 0 -100px;
    color: #FFF;
    font-size: 22px;
    text-decoration: none;
    text-align: center;
    border: 1px solid #FFF;
    border-radius: 16px;
    padding-left: 1%;
    padding-right: 1%;
}
Miguel Mota
  • 20,135
  • 5
  • 45
  • 64
0

Try:

left: 50%;
transform: translateX(-50%);
AJ Meyghani
  • 4,389
  • 1
  • 31
  • 35