d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > 100fg To 1st Who Fixes My Css > [css] Header,footer,100% Content?
Add Reply New Topic New Poll
Member
Posts: 613
Joined: Aug 3 2010
Gold: 8,754.00
Nov 20 2012 01:42pm
I am trying to create a layout with a fixed header and a sticky footer and the remaining space for the content. I got it basically, but i cant get the last thing working.
Here is my current state: http://jsfiddle.net/PZjZ9/l
What i want is that the blue content section stretches all the way to the bottom of the page (using non-fixed sizes (-> no px or smth.)) - that is where i am stuck currently.

First one to get me a fix gets 100fg .d
Member
Posts: 1,628
Joined: Aug 11 2012
Gold: 628.00
Nov 20 2012 01:46pm
http://jsfiddle.net/PZjZ9/4/

now check

This post was edited by Huayra on Nov 20 2012 02:14pm
Member
Posts: 613
Joined: Aug 3 2010
Gold: 8,754.00
Nov 20 2012 02:42pm
Quote (Huayra @ Nov 20 2012 09:46pm)


Not exatcly what i wanted and not corrent (try to put more text in the content section (http://jsfiddle.net/bgUff/)) - but you put some effort in this - earns fgs - 25fg for that
(Basically its OK to change the html if it gets things working)

The 100fg stands -> more soltions? :D
Member
Posts: 1,628
Joined: Aug 11 2012
Gold: 628.00
Nov 20 2012 03:02pm
Quote (Necator @ Nov 20 2012 02:42pm)
Not exatcly what i wanted and not corrent (try to put more text in the content section (http://jsfiddle.net/bgUff/)) - but you put some effort in this - earns fgs - 25fg for that
(Basically its OK to change the html if it gets things working)

The 100fg stands -> more soltions? :D


nvm

This post was edited by Huayra on Nov 20 2012 03:03pm
Member
Posts: 20,464
Joined: Dec 31 2006
Gold: 131.00
Nov 21 2012 05:38am
Quote (Necator @ Nov 21 2012 08:42am)
Not exatcly what i wanted and not corrent (try to put more text in the content section (http://jsfiddle.net/bgUff/)) - but you put some effort in this - earns fgs - 25fg for that
(Basically its OK to change the html if it gets things working)

The 100fg stands -> more soltions? :D


not too sure what you are looking for, but here is somthing http://jsfiddle.net/eFxB6/1/
Member
Posts: 1,628
Joined: Aug 11 2012
Gold: 628.00
Nov 21 2012 11:55am
are you trying to make the footer sticky too?

http://jsfiddle.net/PZjZ9/13/
Member
Posts: 613
Joined: Aug 3 2010
Gold: 8,754.00
Nov 21 2012 02:39pm
OK, Lets do some FG rewarding:

First WhyteLinux:
Quote (WhyteLinux @ Nov 21 2012 01:38pm)
not too sure what you are looking for,  but here is somthing http://jsfiddle.net/eFxB6/1/


This is wrong.. try it with more content .. will get messy at the bottom of the page. Anyways .. i don't want effort go unrewarded: 10fgs

Second Huayra:
Quote (Huayra @ Nov 21 2012 07:55pm)
are you trying to make the footer sticky too?

http://jsfiddle.net/PZjZ9/13/


Very good. If there is no content there seems to be a scrollbar .. not exactly what we were looking for - but still: 79fgs

OK - so i think thats it with the fgs guys
Thx everyone who put some effort into this.
Member
Posts: 5,403
Joined: Aug 8 2007
Gold: 836.50
Dec 6 2012 01:36pm
I know the contest is over but here's what I did:

http://jsfiddle.net/PZjZ9/31/
Member
Posts: 106
Joined: May 16 2009
Gold: 25.55
Dec 27 2012 05:14pm
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
html { height: 100%; }
body {
 margin: 0;
 padding: 0;
 height: 100%;
 background-color: orange;
}

header {
 position: fixed;
 top: 0;
 left: 0;
 width: 100%;
 background: red;
 overflow: hidden;
}

footer {
 position: absolute;
 bottom: 0;
 left: 0;
 width: 100%;
 background: red;
 overflow: hidden;
}

#outer-wrapper {
 position:relative;
 height:100%;
 width: 100%;
 background-color: green;
 overflow: auto;
}

#inner-wrapper {
 height:100%;
 width: 15em;
 margin: auto;
 padding: 0 20px;
 background-color: blue;
 overflow:auto;
}​
</style>
</head>
<body>

<div id="outer-wrapper">

 <header> HEADER </header>

   <div id="inner-wrapper">
     CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
     CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
     CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
     CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
   </div>

   <footer> FOOTER </footer>

 </div>

</body>

</html>

</body>
</html>


I think that is it actually. Fixes over flow problem automatically thanks to this
Code
 overflow:auto;


Enjoy
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll