Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change flow of document

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
GB
ok, follow on from my last post. Thinking to much!!

Is it possible without using a lot of document.write's to change the flow of a document ie If you have no javascript you see

<div id="header"></div>
<div id="menu"></div>
<div id="heading"></div>
<div id="bodycontent"></div>
<div id="footer"></div>

if you have javascript move the flow so. The idea is if you have javascript the menu sits at teh bottom of the page, that fits to the screen.
If you have no javascript the page will be 100% but the menu needs to be at the top :)

<div id="header"></div>
<div id="heading"></div>
<div id="bodycontent"></div>
<div id="menu"></div>
<div id="footer"></div>
 
I think the best solutions involves not changing the html at all. Put your divs in any order you want in the html and use css to position them. Then create two external css files, one for people with javascript and one for people without. In the head of your page link to the non-javascript css as usual. Then have a small javascript that changes the css to the javascript one.

This way people without javascript stay with that css file and everything gets positioned that way. Someone with javascript gets that css file and everything gets positioned accordingly. Best of all all your html stays small and simple.
 
Check out the post called 100% div height and check out what i am trying to do :)

Positioning cannot really be done just with css flow from what i can see :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top