My webpage needs to work in modern browsers such as Chrome but also on older browsers such as IE11.
Most of it works but when I try to put a button in the middle of the container parent div
using calc (left: calc(50% - 40px);)
it will not work in IE11 and will instead be placed outside of the parent container.
Here is my CSS code:
.buttonContainer {
position: fixed;
width: 336px;
height: 62px;
background-color: #fff;
display: inline-block;
text-align: center;
vertical-align: middle;
margin-bottom: 10px;
box-shadow: 0 0 2px 0 #d2d2d2;
}
.button {
position: fixed;
left: calc(50% - 40px);
.color {
background-color: #ff0033;
color: #ffffff;
display: inline-block;
height: 26px;
width: 64px;
margin-top: 10%;
padding: 8px 16px;
font-size: 14px;
cursor: pointer;
text-align: center;
vertical-align: middle;
line-height: 28px;
}
}
Above will work in modern browsers where .button
will be in the middle of buttonContainer
, but it'll be on the outside of it in IE11.