I am working on a project for a scanner which runs IE5 (yeah I know!) and they have requested that a link should be a block element with a height. Inside this block, they want the it's contents to be aligned to the centre both vertically and horizontally.
I have this html (for one):
<a class="block cancel vertical-align text-center" href="#" id="btn-cancel">
<h4>Cancel</h4>
</a>
and the SCSS for that is:
.block {
display: inline-block;
*zoom: 1;
*display: inline;
height: 100%;
width: 100%;
background-color: #3C60EF;
.block-content {
padding: 4px;
> h1, > h2, > h3, > h4, > h5 {
margin-top: 0;
}
@media screen and (min-width: 992px) {
padding: 10px;
}
}
}
.block.vertical-align {
display: table-cell;
vertical-align: middle;
h3, h4, h5, h6, p, .block-content {
padding: 0 10px !important;
}
form {
.form-group {
margin: 0;
}
}
}
a.block {
background-position: center center;
background-repeat: no-repeat;
}
.text-center {
text-align: center;
}
this works fine on my machine (using latest browsers) but on the scanner everything is aligned to the top.
Can anyone suggest anything that might help me?
is a block element, while is inline... block inside inline is not allowed, and weird things can happen when you do so... I'd suggest to change that markup too
– Jesus Lugo Apr 09 '15 at 04:33