Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

sliding doors technique - dumb question

Aug 6, 2007 11:36AM PDT

Hello, i just read the sliding doors technique
http://www.alistapart.com/articles/slidingdoors/
which is awesome, and i did understand everything but, why does the header div needs to be floated left and have a width of 100 %

I think the answer is pretty easy, but I can't figure it out.

Thanks, Marcelo.

Discussion is locked

- Collapse -
Well
Aug 7, 2007 1:36AM PDT

I would assume so it aligns all the way to the left of the page, and then it's 100% since the menu expands and contracts based on the window size of the browser... so the 100% makes sure to always use as much space as the window allows.

~Sovereign

- Collapse -
mmm
Aug 7, 2007 5:18AM PDT

No, I don't think that's not the reason, if you have a div with a width of 100% there is no reason to float it for alignment, as it is a block level element. And it will fill the whole width of the window.
I'm pretty sure it is some sort of hack or something.