I’m a web developer that is making my first serious stab at using CSS for layout and style. My question is more about layout.
I’m using XHTML 1.0 Strict. My main content is in a div with the class “content”.
This div contains the layout between header and footer, and that layout may change at any time.
In this case the page has two columns; The left begin a third, the right with the remaining two thirds.
The left column contains a background image that is to repeat on y only. This area has a class of “sidebar” The right column, named “article” most always will have content longer than the sidebar, so the sidebar must run the length of the article. When finished the image will butt-up against the footer image.
The problem is that I can only get this to work if I use inline styles. I can use and external style sheet for some formatting, but If I try to use an external style sheet to set the float and so on, the background image will only go the length of the sidebar content.
I’ve want to mainly go with the style sheet and not inline. How would I do this?
Page Code
<div style="background-image:url(/wing/global/graphics/sidebar_slvr.gif); background-repeat:repeat-y; float:left">
<div style="padding-left:15px; width:225px" class="side_bar"><!-- left side bar --></div>
<div style="border: 0px solid #000000; width:500px; float:right;"><!-- right third content --></div>
</div>
Styles Used
.side_bar {
background-image: url(../graphics/sidebar_slvr.gif);
background-repeat: repeat-y;
height: inherit;
width: 246px;
float: left;
}
BTW - The div with the class name "article" is only named that to identify it and for the print style sheet.
I'm open to better alternatives for this to work.
Thanks in advance for all your help.



Reply With Quote

Bookmarks