I would like to focus the next jsfiddle on centering vertically at any time, the responsive design makes it difficult for me to guess where to get the value, because all the tutorials in StackOverflow say: "The div containing the content must have width and height." I made an image of how she is now (bad) and how I want her to be (good)
<- centered vertically and horizontally on all devices / widths / orientation
https://jsfiddle.net/34o9vcba/9/
https://jsfiddle.net/34o9vcba/9/embedded/result/
Markup
<div class="wrapper">
<div class="rowOne">
<div class="telefoonButton">
<a href="tel:0652333817" title="Bel ons"><img src="http://eightytwenty.nl//wordpress/wp-content/uploads/2015/12/phoneNook.png" alt="telefoon" class="Center-Block Absolute-Center is-Image"></a>
</div>
<div class="mailButton">
<a href="mailto:slotenmakerdenhaag@gmail.com" title="Mail ons"><img src="http://eightytwenty.nl/wordpress/wp-content/uploads/2015/12/mailNook.png" alt="mail" class="Center-Block Absolute-Center is-Image"></a>
</div>
</div>
<div class="rowTwo">
<div class="infoButton">
<a href="contact" title="Bel ons"><img src="http://eightytwenty.nl//wordpress/wp-content/uploads/2015/12/infoNook.png" alt="telefoon" class="Center-Block Absolute-Center is-Image"></a>
</div>
<div class="contactButton">
<a href="contact#contact" title="Mail ons"><img src="http://eightytwenty.nl//wordpress/wp-content/uploads/2015/12/contactNook.png" alt="mail" class="Center-Block Absolute-Center is-Image"></a>
</div>
</div>
</div>
CSS
.wrapper {
height: 80vh;
margin: 0 auto;
width: 90%;
}
.rowOne, .rowTwo {
width: 50%;
height: auto;
float: left;
}
.Absolute-Center.is-Image {
height: auto;
}
.Absolute-Center.is-Image img {
width: 50%;
height: auto;
}
source
share