I have implemented liquid layout for my website. I have set width of body tag to 100%.
<html>
<head>
</head>
<body>
<div id="container">
some content
</div>
</body>
body
{
margin: 0;
padding: 0;
width: 100%;
}
For some pages vertical scrollbar is displayed. Because of which body tag width reduces by 16px. I need to set body width in such a way that display of scrollbar doesn’t affect it.
I have tried following but it didn’t work with FF9. :
body{ width: -moz-calc(100% - 16px); }
Can any body suggest a way to achieve this?
One way to work around this is to make sure scroll bars are always present. You can then style your pages with confidence that they’re not going to shift left and right.
You can also do:
(I don’t think the overflow method works with Opera though)