The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS width:100%; and fix width problem Reply To: width:100%; and fix width problem



Do you mean that the 100% element shrinks with the viewport but when you scroll to see the content off to the right because of some fixed width content the background colour is no longer around the fixed width element?

If so then find the largest fixed-width item in your page (say 1000px) then set a min-width of 1000px on the 100% wrapper (min-width:1000px). This will ensure the background doesn’t keep shrinking when the viewport is smaller than the fixed width element.