css - calc() in Safari for left -
this question has answer here:
i center div within 1 using calc() function. works fine in chrome, firefox, opera , in ie in safari method doesn't work.
any suggestions without javascript fixation?
left: -webkit-calc(50% - 25px); left: -moz-calc(50% - 25px); left: calc(50% - 25px);
as hashem said, doesn't work in earlier versions of safari.
however if want center div, couple ideas come mind.
one, give container
margin-right: auto; margin-left: auto; width: 50%;
or make width whatever like.
second, give parent div
text-align:center;
make child div
display: inline-block;
and/or set width child div.
Comments
Post a Comment