Seperating Navbar, Banner, Footer, Sponsers, and the pages contents.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    Seperating Navbar, Banner, Footer, Sponsers, and the pages contents.

    I have my entire page in my "main" div.

    [CODE=CSS]div.main
    {
    width: 100%;
    height: 100%;
    border: 1px solid gray;
    }[/CODE]
    on the left of the page I have a banner.

    [CODE=CSS]div.banner
    {
    border-right: 1px solid gray;
    float: left;
    }[/CODE]

    [HTML]<div class="banner">
    <img src="Location" width="200" height="650" />
    </div>[/HTML]

    on the right I have the sponsers banner.

    [CODE=CSS]div.sponser
    {
    border-left: 1px solid gray;
    float: right;
    margin: 0;
    }[/CODE]

    [HTML]<div class="sponser" >
    <img src="Location" width="200" height="650" />
    </div>[/HTML]

    Inbetween the banner and the sponsers, I have a navagation bar.

    [CODE=CSS]ul.list1
    {
    float: left;
    margin: 0;
    list-style-type: none;
    }

    a.nav
    {
    float: left;
    text-decoration: none;
    color: #000000;
    background-color: #e00000;
    padding: 0.2em 0.6em;
    border-right: 1px solid #000000;
    font-size: 20px;
    }

    a.nav:hover
    {
    color: #e00000;
    background-color: #000000;
    }

    li.navin
    {
    display: inline;
    }[/CODE]

    [HTML]<ul class="list1">
    <li class="navin">< a class="nav" href="Home.html ">Home</a></li>
    <li class="navin">< a class="nav" href="Storys.ht ml">Storys</a></li>
    <li class="navin">< a class="nav" href="Blogs.htm l">Blogs</a></li>
    <li class="navin">< a class="nav" href="Music.htm l">Music</a></li>
    <li class="navin">< a class="nav" href="Videos.ht ml">Video</a></li>
    <li class="navin">< a class="nav" href="About.htm l">About</a></li>
    </ul>[/HTML]

    Then under the navagation bar I have the pages contents.

    [CODE=CSS]div.contents
    {
    color: #e00000;
    font-size: 17px;
    padding: 5em;
    border-top: 1px solid gray;
    border-bottom: 1px solid gray;
    float: left;
    }[/CODE]

    [HTML]<div class="contents ">

    <!-- 19 line breaks to extend the page -->

    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

    </div>[/HTML]

    And below the contents I have the footer.

    [CODE=CSS]ul.list2
    {
    padding: 0;
    margin: 0;
    list-style-type: none;
    }

    a.footer
    {
    color: #e00000;
    }

    a.footer:hover
    {
    color: #000000;
    background-color: #e00000;
    }
    li.footerin1
    {
    display: inline;
    }

    li.footerin2
    {
    display: inline;
    }
    div.footer1
    {
    margin-left: 395px;
    }

    div.footer2
    {
    margin-left: 425px;
    }[/CODE]

    [HTML]<div class="footer1" >
    <ul class="list2">
    <li class="footerin 1"><a class="footer" href="Home.html "><Home</a></li>
    <li class="footerin 1"><a class="footer" href="Storys.ht ml">Storys</a></li>
    <li class="footerin 1"><a class="footer" href="Blogs.htm l">Blogs</a></li>
    <li class="footerin 1"><a class="footer" href="Music.htm l">Music</a></li>
    <li class="footerin 1"><a class="footer" href="Videos.ht ml">Videos</a></li>
    <li class="footerin 1"><a class="footer" href="About.htm l">About</a></li>
    </div>
    <div class="footer2" >
    <li class="footerin 2"><a class="footer" href="Help.html ">Help</a></li>
    <li class="footerin 2"><a class="footer" href="Suggestio ns.html">Sugges tions</a></li>
    <li class="footerin 2"><a class="footer" href="Support.h tml">Support</a></li>
    </ul>
    </div>[/HTML]

    Here are my problems.

    My footer is literally right below my div.contents bottom border, and I can can't get it to go down.

    I want the banner and sponsers to be eqaul with the rest of the divisions, but when I stretch the image, it make the div.main longer, and it puts space between the images borders and the div.main bottom border.

    And my div.contents, top and bottom borders don't go all the way right into the sponsers, they stop about a cenimeter short.


    Here's the entire code I did it the way I did above so it would be easier to read.

    [HTML]<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

    <html>
    <head>
    <title>Home Page</title>
    <style type="text/css">

    body
    {
    background-color: black;
    }

    div.main
    {
    width: 100%;
    height: 100%;
    border: 1px solid gray;
    }

    ul.list1
    {
    float: left;
    margin: 0;
    list-style-type: none;
    }

    ul.list2
    {
    padding: 0;
    margin: 0;
    list-style-type: none;
    }

    a.nav
    {
    float: left;
    text-decoration: none;
    color: #000000;
    background-color: #e00000;
    padding: 0.2em 0.6em;
    border-right: 1px solid #000000;
    font-size: 20px;
    }

    a.nav:hover
    {
    color: #e00000;
    background-color: #000000;
    }

    a.footer
    {
    color: #e00000;
    }

    a.footer:hover
    {
    color: #000000;
    background-color: #e00000;
    }

    li.navin
    {
    display: inline;
    }

    li.footerin1
    {
    display: inline;
    }

    li.footerin2
    {
    display: inline;
    }

    div.contents
    {
    color: #e00000;
    font-size: 17px;
    padding: 5em;
    border-top: 1px solid gray;
    border-bottom: 1px solid gray;
    float: left;
    }

    div.footer1
    {
    margin-left: 395px;
    }

    div.footer2
    {
    margin-left: 425px;
    }

    div.banner
    {
    border-right: 1px solid gray;
    float: left;
    }

    div.sponser
    {
    border-left: 1px solid gray;
    float: right;
    margin: 0;
    }

    </style>
    </head>

    <body>

    <div class="main">

    <div class="banner">
    <img src="Location" width="200" height="650" />
    </div>

    <ul class="list1">
    <li class="navin">< a class="nav" href="Home.html ">Home</a></li>
    <li class="navin">< a class="nav" href="Storys.ht ml">Storys</a></li>
    <li class="navin">< a class="nav" href="Blogs.htm l">Blogs</a></li>
    <li class="navin">< a class="nav" href="Music.htm l">Music</a></li>
    <li class="navin">< a class="nav" href="Videos">V ideo</a></li>
    <li class="navin">< a class="nav" href="About.htm l">About</a></li>
    </ul>

    <div class="sponser" >
    <img src="Location" width="200" height="650" />
    </div>

    <div class="contents ">

    <!-- 19 line breaks to extend the page -->

    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

    </div>

    <div class="footer1" >
    <ul class="list2">
    <li class="footerin 1"><a class="footer" href="Home.html "><Home</a></li>
    <li class="footerin 1"><a class="footer" href="Storys.ht ml">Storys</a></li>
    <li class="footerin 1"><a class="footer" href="Blogs.htm l">Blogs</a></li>
    <li class="footerin 1"><a class="footer" href="Music.htm l">Music</a></li>
    <li class="footerin 1"><a class="footer" href="Videos.ht ml">Videos</a></li>
    <li class="footerin 1"><a class="footer" href="About.htm l">About</a></li>
    </div>
    <div class="footer2" >
    <li class="footerin 2"><a class="footer" href="Help.html ">Help</a></li>
    <li class="footerin 2"><a class="footer" href="Suggestio ns.html">Sugges tions</a></li>
    <li class="footerin 2"><a class="footer" href="Support.h tml">Support</a></li>
    </ul>
    </div>

    </div>


    </body>
    </html>[/HTML]


    Thanks, Death

    PS - If there are better ways to do what i'm doing please let me know.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    You are forgetting that floated elements are removed from the normal flow and other elements will pretend they aren't there. Because content, sponsor, banner are all floated, the footer rises up into their place (except for the actual content).

    Comment

    • Death Slaught
      Top Contributor
      • Aug 2007
      • 1137

      #3
      Originally posted by drhowarddrfine
      You are forgetting that floated elements are removed from the normal flow and other elements will pretend they aren't there. Because content, sponsor, banner are all floated, the footer rises up into their place (except for the actual content).
      then how can I fix it? i can't get rid of any of the floats because if I do it looks even worse. Espesually in the contents, it moves the first row of text way past the nav bar.


      Thanks, Death

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        This is as far as I got before getting yelled at by the wife. Don't catch divits, ie, the need to feel everything needs to be wrapped in a div.
        [HTML]<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

        <html>
        <head>
        <title>Home Page</title>
        <style type="text/css">

        body
        {
        background-color: black;
        }

        #wrapper{
        position:relati ve;
        overflow:auto;
        }

        .banner{
        float:left;
        width:200px;
        height:650px;
        }
        .sponsor{
        float:right;
        width:200px;
        height:650px;
        }
        .list1{
        float:left;
        width:30%;
        margin:0 auto;
        list-style-type:none;
        }
        a.nav{
        float:left;
        text-decoration:none ;
        color:#000;
        background-color:#e00;
        padding:0.2em 0.6em;
        border-right: 1px solid #000;
        font-size:20px;
        }

        </style>
        </head>

        <body>

        <div class="main">
        <div id="wrapper">
        <img class="banner" src="2.png" />

        <ul class="list1">
        <li class="navin">< a class="nav" href="Home.html ">Home</a></li>
        <li class="navin">< a class="nav" href="Stories.h tml">Stories</a></li>
        <li class="navin">< a class="nav" href="Blogs.htm l">Blogs</a></li>
        <li class="navin">< a class="nav" href="Music.htm l">Music</a></li>
        <li class="navin">< a class="nav" href="Videos">V ideo</a></li>
        <li class="navin">< a class="nav" href="About.htm l">About</a></li>
        </ul>

        <img class="sponsor" src="2.png" />

        <div class="contents ">

        <!-- 19 line breaks to extend the page -->

        <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

        </div>
        </div>

        <ul class="list2">
        <li class="footerin 1"><a class="footer" href="Home.html ">Home</a></li>
        <li class="footerin 1"><a class="footer" href="Storys.ht ml">Storys</a></li>
        <li class="footerin 1"><a class="footer" href="Blogs.htm l">Blogs</a></li>
        <li class="footerin 1"><a class="footer" href="Music.htm l">Music</a></li>
        <li class="footerin 1"><a class="footer" href="Videos.ht ml">Videos</a></li>
        <li class="footerin 1"><a class="footer" href="About.htm l">About</a></li>
        </ul>

        <ul>
        <li class="footerin 2"><a class="footer" href="Help.html ">Help</a></li>
        <li class="footerin 2"><a class="footer" href="Suggestio ns.html">Sugges tions</a></li>
        <li class="footerin 2"><a class="footer" href="Support.h tml">Support</a></li>
        </ul>


        </div>


        </body>
        </html>[/HTML]

        Comment

        • Death Slaught
          Top Contributor
          • Aug 2007
          • 1137

          #5
          Any way you can finish it? i'm totally lost. i tried putting the sponser pic in, and it fits perfectly inside of it, but when I tried to put the banner pic in, it went wrong, it puts it outside of the box where it needs to go and that pushes the navbar over.

          Also I need the footer links to go inbetween the banner and sponsers pics, kinda like the 2 pics are the borders and nothing need to go above, outside, or below them.


          Thanks alot, Death

          PS - Usually I would never ask for the answer, but I was up till 3:00 in the morning last night trying every things I could think of to fix it, and my parents were ready to kill me. CSS is not my thing, but it's alot better than a pure HTML site.......fram es (twitch) bad idea.

          Comment

          • drhowarddrfine
            Recognized Expert Expert
            • Sep 2006
            • 7434

            #6
            Busy weekend. It started raining outside so now I have to work inside.
            I was hoping you could study what I did and finish it.

            Comment

            • Death Slaught
              Top Contributor
              • Aug 2007
              • 1137

              #7
              Originally posted by drhowarddrfine
              Busy weekend. It started raining outside so now I have to work inside.
              I was hoping you could study what I did and finish it.
              I think I can work it out, but I have one more question.

              Would I use margin-left to move the footer over to the middle of the page, and the use margin-bottom to move it up?

              Thanks, Death

              Comment

              • drhowarddrfine
                Recognized Expert Expert
                • Sep 2006
                • 7434

                #8
                If you want to center it, give it a width and then 'margin:0 auto;'. Not sure about a margin off the bottom cause that could be trickier. One trick is to wrap everything on the page in a div except the footer. Then give the footer a negative margin which will pull it back inside the wrapper div but keep it at the bottom.

                Comment

                • Death Slaught
                  Top Contributor
                  • Aug 2007
                  • 1137

                  #9
                  Originally posted by drhowarddrfine
                  If you want to center it, give it a width and then 'margin:0 auto;'. Not sure about a margin off the bottom cause that could be trickier. One trick is to wrap everything on the page in a div except the footer. Then give the footer a negative margin which will pull it back inside the wrapper div but keep it at the bottom.
                  I got it where I want it but I have a problem.......t he first row has a space between it and the second row......how would I fix that?

                  Also I'm trying to make all my borders glow, but for that it has to have a width property and when I try to give it one it looks worse.

                  and it looks different from comp-comp, it's driving me nuts(it's only the footer).
                  Oh and FF is a nightmare all it's own.

                  Here's what I got so far:

                  [HTML]<!DOCTYPE html
                  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

                  <html>
                  <head>
                  <title>Home Page</title>
                  <style type="text/css">

                  body
                  {
                  background-color: black;
                  }
                  .main{
                  border-top:1px solid gray;
                  border-left:1px solid gray;
                  border-right:1px solid gray;
                  border-bottom:1px solid gray;
                  }
                  #wrapper{
                  position:relati ve;
                  overflow:auto;
                  }
                  .banner{
                  float:left;
                  width:200px;
                  height:650px;
                  }
                  .sponsor{
                  float:right;
                  width:200px;
                  height:650px;
                  }
                  .list1{
                  float:left;
                  margin:0 auto;
                  list-style-type:none;
                  }
                  .list2{
                  margin-left:375px;
                  }
                  .list3{
                  margin-left:413px;
                  }
                  a.nav{
                  float:left;
                  text-decoration:none ;
                  color:#000;
                  background-color:#e00;
                  padding:0.2em 0.6em;
                  border-right: 1px solid #000;
                  font-size:20px;
                  }
                  a.nav:hover{
                  color:#e00;
                  background-color:#000;
                  }
                  a.footer{
                  color:#e00;
                  background-color:#000;
                  }
                  a.footer:hover{
                  color:#000;
                  background-color:#e00;
                  }
                  li.navin{
                  display:inline;
                  }
                  li.footerin{
                  display:inline;
                  }
                  .contents{
                  color:#000;
                  padding:10em;
                  float:left;
                  border-top:1px solid #000;
                  border-bottom:1px solid #000;
                  filter:glow;
                  }
                  </style>
                  </head>

                  <body>

                  <div class="main">
                  <div id="wrapper">
                  <img class="banner" src="C:\Web\Dea th.jpg" alt=" " />


                  <ul class="list1">
                  <li class="navin">< a class="nav" href="Home.html ">Home</a></li>
                  <li class="navin">< a class="nav" href="Stories.h tml">Stories</a></li>
                  <li class="navin">< a class="nav" href="Blogs.htm l">Blogs</a></li>
                  <li class="navin">< a class="nav" href="Music.htm l">Music</a></li>
                  <li class="navin">< a class="nav" href="Videos">V ideo</a></li>
                  <li class="navin">< a class="nav" href="About.htm l">About</a></li>
                  </ul>

                  <img class="sponsor" src="C:\Web\Dea th.jpg" alt=" " />

                  <div class="contents ">

                  <!-- 19 line breaks to extend the page -->

                  Text Text Text Text Text Text Text Text Text Text Text Text Text

                  <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

                  </div>

                  <ul class="list2">
                  <li class="footerin "><a class="footer" href="Home.html ">Home</a></li>
                  <li class="footerin "><a class="footer" href="Storys.ht ml">Storys</a></li>
                  <li class="footerin "><a class="footer" href="Blogs.htm l">Blogs</a></li>
                  <li class="footerin "><a class="footer" href="Music.htm l">Music</a></li>
                  <li class="footerin "><a class="footer" href="Videos.ht ml">Videos</a></li>
                  <li class="footerin "><a class="footer" href="About.htm l">About</a></li>
                  </ul>
                  <ul class="list3">
                  <li class="footerin "><a class="footer" href="Help.html ">Help</a></li>
                  <li class="footerin "><a class="footer" href="Suggestio ns.html">Sugges tions</a></li>
                  <li class="footerin "><a class="footer" href="Support.h tml">Support</a></li>
                  </ul>

                  </div>
                  </div>


                  </body>
                  </html>




                  [/HTML]


                  Thanks, Death

                  Comment

                  • drhowarddrfine
                    Recognized Expert Expert
                    • Sep 2006
                    • 7434

                    #10
                    There is no such thing as 'filter:flow'. IE-only.
                    FF is a nightmare compared to what? If it doesn't work in IE then the markup is wrong. FF is not the problem.

                    Gone till tonight.

                    Comment

                    • Death Slaught
                      Top Contributor
                      • Aug 2007
                      • 1137

                      #11
                      Originally posted by drhowarddrfine
                      There is no such thing as 'filter:flow'. IE-only.
                      FF is a nightmare compared to what? If it doesn't work in IE then the markup is wrong. FF is not the problem.

                      Gone till tonight.

                      sorry typo I ment filter:glow;

                      and the pics wont even show up in FF that's what I ment, and by no means do I mean that IE is better than FF.


                      Thanks, Death

                      Comment

                      • drhowarddrfine
                        Recognized Expert Expert
                        • Sep 2006
                        • 7434

                        #12
                        No, it was my mistyping. There is no such thing as 'filter:glow' either.

                        Comment

                        • Death Slaught
                          Top Contributor
                          • Aug 2007
                          • 1137

                          #13
                          Originally posted by drhowarddrfine
                          No, it was my mistyping. There is no such thing as 'filter:glow' either.
                          You mean there's no such thing as filter:glow; in all browsers except IE right? Cause it works there, and it looks great, but I guess it's gota go now....oh well lol.

                          Thanks, Death

                          Comment

                          • Death Slaught
                            Top Contributor
                            • Aug 2007
                            • 1137

                            #14
                            Ok I stepped away from the computer for a while so I wouldn't start beating it with a mallet, but if I can't get this stupid footer to work I'm going to start beating myself with a mallet =p.

                            Here's the problem this time:

                            Every time I take it and test on a different computer the footer apears somewhere else......mainl y on the left side shoved way up, right next to the contents. I thought I had fixed that by giving the contents of the page 10em but that apparanetly didn't work, so how can I get the top row to stay centered, and the bottom row exactly below it but centered below the first footer. ( If this doesn't make much sense then please tell me and i'll try to make it a bit more clear ).

                            Thanks, Death

                            Comment

                            Working...