Help with CSS, please?
October 26, 2006 2:50 AM
Subscribe
Posting on behalf of a friend:
CSS Absolute / relative positioning problem. In designing a course website which has to validate as XHTML (Strict or Transitional), I've come up against a problem with an image. I want the image to remain in the right hand div but resize gracefully. My problem is that the trowel image either interferes with the header (is too high) but IS able to move with the page or doesn't interfere with anything but won't resize with the page!
posted by dance to clothing, beauty, & fashion (4 comments total)
First thing, you need to define widths for the parents. The sidebar isn't currently floating properly because the width isn't defined. It should be 35%, to account for the margins and padding on the "main" div. Second, the trowel div then needs to be defined as having a width of 100%, and then you can define the #trowel img in css to have a relative width, 100% or 50% or whatever.
You don't need to float the main AND the sidebar, just one or the other, as long as the floated div is before the non-floated div.
I assume your friend is just learning, based on the code. There are lots of good tutorials out there, usually just google something like "css div float img relative" or similar. w3schools is always a good start.
posted by maxwelton at 3:25 AM on October 26, 2006