This is my first attempt at a fluid width site, and I'm having trouble achieving the layout I want.
Basically, I want a fixed width image on the right (#staticDiv in the code), a fluid width paragraph on the left (#fluidDiv in the code), and a footer under all of that. The problem is that I can't seem to this to work without resorting to some javascript.
Here's a simplified version of what I'm working with now
I fully understand WHY it's not working, the "staticDiv" is absolutely positioned, therefore outside of the normal element flow, so the footer sits below the #fluidDiv, which is the only element still in the "flow"... but this is the closest I've been able to get to the result I want.
Any ideas before I give up and start using Javascript?
Basically, I want a fixed width image on the right (#staticDiv in the code), a fluid width paragraph on the left (#fluidDiv in the code), and a footer under all of that. The problem is that I can't seem to this to work without resorting to some javascript.
Here's a simplified version of what I'm working with now
Code:
<html> <head> <title>Test</title> <style type="text/css"> #fluidDiv { background-color: orange; float: left; margin-right: 375px; } #staticDiv { background-color: green; width: 350px; height: 482px; position: absolute; right: 20px; } footer { display: block; background-color: yellow; width: 100%; clear: both; } </style> </head> <body> <div id="fluidDiv"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> <div id="staticDiv"></div> <footer>Copyright ©2011</footer> </body> </html>
Any ideas before I give up and start using Javascript?
Comment