This maybe a silly question, but is there a way I can get div3 to sit directly below div1 without using two container divs (one for div1 and div3 and one for div2)?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
But it still doesn't work unless I missed something else?
Sorry if I am being thick... Here is the latest code with no float left and added clear left!
Thanks again, I really appreciate the help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
Thanks for your input...
Sorry if I haven't explained myself very well!
Please see attached images.
Basically what I want is to present my content in divs as follows:
If someone has a wider screen, then I would like the divs to line up in two colums as in image 1.
If they have a smaller screen then I would like it to line up in a single column as in image 2.
The plan was to detect the width of the screen by javascript and set the widths of the divs by css to 100% if the screen is small and change (again by javascript) to 49% if the screen is large.
I have the javascript working ok and only included (ealier in the posts) the code for the wider screen to keep it simple. This is almost working but I am getting the same as you ray326 - I'm really looking for the green block to be tucked up neatly under the blue and I don't know if this is possible.
Hope that makes sense.
If I can't do this this way (which would be really neat and simple!) then I think the alternative is to start with two container divs and change the widths of them and move the contents around to get the same effect but it would be much messier I think.
I don't see a way to make it work like you want it to.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
you can set d3's "margin-top:-49px;". Beacuse you know the height of d1 and d2, so you can easy to know where you d3 can go. Using Javascript to add this attribute in.
Bookmarks