it seems to be a common practice to use a div with a class of “container” or “content” or something similar around the main content to help with the css-design of the page.
I personally don’t like that, because it is (in my opinion) a violation of the rule to seperate presentation from content (because the -element serves no semantic purpose).
So my question is: Is there any way to get a similar result with just CSS? To be more specific, I want the site to have a background-image, but to have a solid white background around the main content.
I already tried something like setting two backgrounds for , one the image, the second a solid white and then size the second one down, but I guess, you can only use background-size on images?
Thanks in advance
You could use the
htmlorbodyelements, except this is problematic across various browsers, which is why people frequently use a div.