Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Viken Karaguesian
December 29, 2005, 12:25 pm
rate this thread
This question is half css and half html based, so I chose this group. I
have a theortical question. When positioning floating <div>'s, how much
does it matter what order you put itin in the html? Consider this
In the website I run, I use two column liquid layout modeled after the
one here: http://www.alistapart.com/articles/negativemargins /
The sidebar div is floated right and content div is to the left (not
floated). In my html, I have the sidebar div first, followed by the
content div. This works as intended. BUT....when the site loads, I'd
like the content div to display first, *before* the sidebar. When I
switch their positions (content first, then sidebar) the layout does
My question is: shouldn't it work? If the side bar is floated to the
right and has a specific width, should it matter whether it comes
before the content div or after the content div? It seems like this
layout should be "reversible". When I place the side bar first, it
floats right and the content div comes up and takes the remaining space
on the left. The content div is margined to allow space for the
sidebar. I assumed that placing the content first would still allow the
sidebar to come up into the space I provided for it.
The interesting thing is: if I reverse the float (float content left
and leave sidebar unfloated) it still doesn't work.
Here's what my css looks like:
border: solid 2px white;
border-right: solid 1px white;
padding: 0 0 1px 0;
...and here's the basic layout of my html:
and here's the site for reference: www.sayatnova.com
Thanks in advance for any replies. You all are really helping me learn
Re: Floating DIV positioning. How much does the order matter?
Viken Karaguesian wrote:
"Float" is a generalization of the "align" attribute for <img>. A
floated block positions in a similar way as an image. Place the floated
block after a fixed block, it floats there, after the block.
Place the floated block before a fixed block, the contents of the fixed
block flow around the floated one.
What does "not work" mean?
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
- Viken Karaguesian
December 30, 2005, 12:47 am
- » newbie: how to make a url appear in the search engines
- — Next thread in » HTML Authoring Forum