I've got a problem with vertical centering in Safari, using margin: auto 0; on a div which is nested inside a div with display: inline-flex;
It works just fine in Firefox, Chrome, Opera... but fails in Safari (and on the default Android browser but I'm considering using a separate CSS for that and whatever iPads use)
Here's the code (I am using Bootstrap, btw): http://jsfiddle.net/n2V5q/1/
<div class="container-fluid head" id="slide1">
<div class="col-md-6 logo">
<img src="img/logo.png" alt="THE LOGO" />
</div>
</div>
and
.container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.head {
color: #fff;
width: 100%;
min-height: 100rem; /* for Opera */
min-height: 100vh;
padding: 15px;
background-color: rgba(85,61,148,.9);
box-shadow: 0px 0px 6px #000000;
z-index: 90;
position: relative;
background-image: url('../img/dither2.png');
background-position: center bottom;
background-repeat: repeat-x;
display: -o-flex;
display: -ms-flex;
display: -moz-flex;
display: -webkit-flex;
display: inline-flex;
}
.col-md-6 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.logo {
margin: auto 0;
text-align: center;
}
The simple and quick answer is to add android:gravity="center_vertical" to the parent(containing) view.
Add text-align:center to <li> or <a> to center the links. Add the border property to <ul> add a border around the navbar. If you also want borders inside the navbar, add a border-bottom to all <li> elements, except for the last one: Home.
try it in you head class
display: -webkit-inline-box;
-webkit-box-pack: center;
-webkit-box-align: center;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With