I do not know how to ask about this, forgive me if I am unclear and please ask me to clarify. I want to center the page and have a “sidebar” to the right inside the centralized content, and not to the right of the viewport. This is pretty simple, except that the item should be as tall as the viewport. However, if the body tag is higher, I want it to be as tall as the body tag. I need this because the sidebar has a background that must repeat along the y axis to cover the entire viewport. I probably didn't explain anything, so maybe this jsFiddle will clarify any missing details.
http://jsfiddle.net/dHerb/
I can set the style .centerto have a static position value that works, but then absolute positioning is canceled. I could turn the sidebar to the right, but the height will not fill the page. I could use JavaScript, but JavaScript should not rely on layout because the element that depends on it makes up a quarter of the contents of the page.
Any pointer would be greatly appreciated.
EDIT: changing the body and html tag to 100% height helps, but it still doesn't quite behave as I described. If there is content from the viewport and you scroll to it before, the background will not be repeated.
source
share