I have 4 different divs. The last one is footer. How can I put the last div at top using CSS?
+1
A:
The last one is the footer but you want to put it at the top ? I'm not sur what you want to do ^^
With JS you could achieve it without doubt.
Maybe could you explain a little bit your situation :-) and when do you want to put the last one to footer (after page is loaded ?)
But with this it should work :
.class1 { position:absolute; top:0; left:0; }
But be sure that your class1 is wraped in another class2 which contains :
.class2 { position:relative; }
Vinzius
2010-09-20 20:47:51
<div id="1">first div</div><div id="2">second div</div><div id="3">3rd div</div><div id="footer">footer</div>
2010-09-20 20:50:16
actually, divs are already there and I want to use CSS to put the footer at different positions.
2010-09-20 20:52:01
Yes but you want to put the footer at different position after page is loaded or by editing your code ? By the way, code of @Anubhav Saini should work too.
Vinzius
2010-09-20 21:01:51
+1
A:
try this:
<div id = "FooterAtTop">what ever here</div>
put this in CSS file or in <style>
in head:
#FooterAtTop
{
position: absolute;
top:0px;
left:0px;
}
Though if you want to keep it floating do this:
#FooterAtTop
{
position: fixed;
top:0px;
left:0px;
}
Hope it helps.
Anubhav Saini
2010-09-20 20:55:08