Setting 100% width for an element, it doesn't consider the scrollbar
Hi
I've a seimple code for create an black rectangle long as the entire body
The problem is that when i resize di windows and the body goes under the min-width, scrollbar appears and moving it i see that the black rectangel is "cut" in the part that exceed
Searching on internet, i've found that solution is to set margin and padding of the body element to 0px... in my case didn't work
It's hard to suggest a solution without knowing your overall design for the page. In your example code, you're positioning the #red <div> with respect to the <body> element. So when the browser window is changed to be narrower than your min-width setting for the <body>, part of that <body> element is cut off from view and the #red <div> is cut off along with it.
If you'll explain your layout in more detail, I'm sure someone can suggest a solution for you.
It's hard to suggest a solution without knowing your overall design for the page. In your example code, you're positioning the #red <div> with respect to the <body> element. So when the browser window is changed to be narrower than your min-width setting for the <body>, part of that <body> element is cut off from view and the #red <div> is cut off along with it.
If you'll explain your layout in more detail, I'm sure someone can suggest a solution for you.
i just want that red assumes the exact body width, not only the visible part
Bookmarks