Center elements

0

Hi, I have enough problems with something quite basic. Getting to center elements, and in this case being very simple, I do not get it.

.Portada {
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.3);
}

#Fondo-Portada {
  height: 100%;
  width: 100%;
  position: absolute;
  z-index: -100;
}

#Logo {
  height: 90px;
  width: 90px;
  margin-top: 30px;
  z-index: 10;
}

#Frase-Presentacion {
  font-family: sans-serif;
  font-size: 40px;
  font-weight: bold;
  color: #FFF;
  text-align: center;
}

#Btn-Ready {
  height: auto;
  width: 300px;
  font-family: sans-serif;
  font-size: 18px;
  background-color: transparent;
  color: #FFF;
  line-height: 26px;
  border-radius: 28px;
  border-color: #b00000;
  cursor: pointer;
  transition: width 0.2s;
}
<div class="Portada">
  <img id="Fondo-Portada" src="Img/Fondo-Presentacion.jpg" alt="">

  <img id="Logo" src="Img/logo70px.png" alt="Logo">

  <p id="Frase-Presentacion"> Hola, soy Carlos. Y diseño y construyo </p>

  <input type="button" id="Btn-Ready" value="I'm ready">
</div>

How would the logo and button image center? I imagine that both is the same.

Thanks !!

    
asked by NEA 08.09.2017 в 14:47
source

1 answer

4

text-align:center; to div and nothing else.

.Portada {
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  text-align:center;
}

#Fondo-Portada {
  height: 100%;
  width: 100%;
  position: absolute;
  z-index: -100;
}

#Logo {
  height: 90px;
  width: 90px;
  margin-top: 30px;
  z-index: 10;
}

#Frase-Presentacion {
  font-family: sans-serif;
  font-size: 40px;
  font-weight: bold;
  color: #FFF;
  text-align: center;
}

#Btn-Ready {
  height: auto;
  width: 300px;
  font-family: sans-serif;
  font-size: 18px;
  background-color: transparent;
  color: #FFF;
  line-height: 26px;
  border-radius: 28px;
  border-color: #b00000;
  cursor: pointer;
  transition: width 0.2s;
}
<div class="Portada">
  <img id="Fondo-Portada" src="Img/Fondo-Presentacion.jpg" alt="">

  <img id="Logo" src="Img/logo70px.png" alt="Logo">

  <p id="Frase-Presentacion"> Hola, soy Carlos. Y diseño y construyo </p>

  <input type="button" id="Btn-Ready" value="I'm ready">
</div>
    
answered by 08.09.2017 / 14:50
source