Skip navigation
lyn100
Currently Being Moderated

How to get grey bar at bottom of page to move up and down

Jun 8, 2012 3:07 PM

Hi

I want to have a grey bar at the bottom of my pages. So far I have used a graphic with a grey bar on the bottom as a background image in the page properties section of my template. This works well, except I am now finding that some pages need more space than what the graphic will allow. Do I need to use frames to achieve this? (I have seen that Adobe don't recommend using frames). Or is there a way to get another graphic of a grey bar to float up and down according to page size? Please respond in layman's terms as I am still a rookie at DW.

thanks.

L

 
Replies
  • Currently Being Moderated
    Jun 8, 2012 3:34 PM   in reply to lyn100
     
    |
    Mark as:
  • Currently Being Moderated
    Jun 8, 2012 3:36 PM   in reply to lyn100

    Best to keep the height of your page flexible because you'll have some long pages and some short pages in your site. 

     

    The following demo shows how to have different background-colors on various sections of your page with CSS. 

     

    You can replace background-colors with CSS gradients or repeating image slices.

    http://alt-web.com/TEST/LHS-test.html

     

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 10:24 AM   in reply to lyn100

    This link shows how to make a sticky footer:

    http://alt-web.com/DEMOS/CSS2-Sticky-Footer.shtml

     

     

    CSS:

     

    #footer {

    position:fixed;

    bottom:0;

    left:0;

    background-color: #666666;

    }

     

     

    HTML:

     

    <div id="footer">

    This is a sticky footer.  Add your footer content here...

    </div>

     

    In addition, you'll need to slice your 4-color background image into 4 separate background images.

    http://whiterockchristiansciencechurch.com/bcsitejune3/images/sidebar4 .png

    Green = #header,

    Charcoal = #topMenu,

    White = #content

    Gray = #footer.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 10, 2012 12:28 PM   in reply to lyn100

    Copy & paste this code into a new, blank HTML document. 

    You can change background-colors to background-images or CSS background-gradients if you prefer.

     

     

    <!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 type="text/css">
    body {
    font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
    font-size: 16px;
    margin:0; padding:0;
    background-color: #CCC;
    }
    
    #header {
    min-height: 100px;
    background-color: #099;
    }
    
    #menu {
    min-height: 45px;
    background-color: #333; 
    color: #FFF;
    }
    
    #content {
    min-height: 500px;
    background-color: #FFF;
    }
    
    #footer {
    min-height: 100px;
    background-color: #666; 
    color:  #FFF;
    /**sticky footer**/
    position:fixed;
    bottom:0;
    left:0;
    width: 100%;
    }
    
    .section {
    width: 880px; /**adjust width as needed**/
    margin:0 auto;  /**this is centered**/
    padding:0 12px; 
    /**for demo purposes, you can remove the border**/
    border: 1px dotted red;
    }
    </style>
    </head>
    <body>
    
    <div id="header">
    your header goes here...
    </div>
    
    <div id="menu">
    <div class="section">
    your navigation goes here...
    </div>
    </div>
    
    <div id="content">
    <div class="section">
    your page content goes here...
    </div>
    </div>
    
    <div id="footer">
    your footer content goes here...
    </div>
    
    
    </body>
    </html>

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 5:58 AM   in reply to Nancy O.

    Why the 100% width on the #footer, Nancy?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 9:26 AM   in reply to MurraySummers

    Murray *ACP* wrote:

     

    Why the 100% width on the #footer, Nancy?

     

    Because footer is fixed and the OP's layout uses 100% width header & footer backgrounds.

     

     

    N

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 9:31 AM   in reply to Nancy O.

    But wouldn't the width go to 100% by default? Does in my tests....

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 9:36 AM   in reply to MurraySummers

    OK - this is interesting.  Position:relative goes to 100%.  Absolute and fixed do not in IE.  Absolute does not in FF, but fixed does.  Strange that....

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 9:40 AM   in reply to MurraySummers

    It doesn't for me in either Firefox 12 or IE9 on Win. 

    Which browsers are you using?

     

     

    N

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 9:45 AM   in reply to MurraySummers

    No.  See the test page -

     

    http://www.gws-sandbox.com/test-div_default.html

     

    It appears that the behavior is the same in IE/FF/Opera/Safari (but not in DW's Design view) - Fixed and Absolute positioning requires you to specify a width for the div.  Relative positioning does not.  I suppose that makes sense.  Thanks - I learned something!

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 12, 2012 9:45 AM   in reply to lyn100

    ...it tells you to create a ‘main’ ap box first and then a ‘container’ which wraps the ‘main’ box as well as all the other elements on the page.

    Any book that instructs you to use APDivs for primary layouts should be burned, OK?  I am not joking.  Nobody, not even experienced web developers should use APDivs for primary layouts because they are removed from the normal document flow. To illustrate what happens when people increase text size in their browsers (as many do), APDivs collide making a jumbled mess.  See screenshot.

     

    SCBC.jpg

     

    In some layouts, it's good to use an outer #container or #wrapper division but it isn't required in all layouts.  Yours doesn't need an outer #container so much as it needs an inner one.   I created a class for this called .section.   The .section div horizontally centers content on screen.

     

    Get rid of Digital Classroom.  Learn HTML & CSS first.  This is required knowledge. 

    HTML & CSS Tutorials - http://w3schools.com/

     

    WEB DESIGN RESOURCES:

    http://forums.adobe.com/message/4105662#4105662

     

    For your first site, use one of the pre-built CSS layouts that comes with Dreamweaver.

    File > New > Blank > HTML > 2-col, fixed layout.

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 12, 2012 10:15 AM   in reply to lyn100

    You can contact me through my web site.

    http://alt-web.com/contact.shtml

     

     

     

    Nancy O.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)