horizontal navigation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • quartzy
    New Member
    • Dec 2007
    • 18

    horizontal navigation

    I am trying to horizontically place my links at the bottom of the header, in its own div.
    But having problems, ie the numbers of the list are still there and the links are placed vertical and not horizontal, I thought the display: inline; would get rid of them being vertical.
    [code=css]
    body {
    font-family: Verdana, sans-serif;
    margin: 0;
    padding: 0;
    }
    #container {
    position: relative;
    width: 80em;
    background-color: #E60073;
    margin-left: auto;
    margin-right: auto;
    }
    #header {
    height: 8em;
    padding: 1em;
    margin: auto;
    }
    img {
    border:0;
    width:750px;
    height:110px;
    margin: auto;
    clear: both;
    align: center;

    }

    #main {
    margin-left: 12em;
    }

    #links {
    margin: 0;
    padding: 0.5em, 3em;
    color: #FFFFFF;
    background: #6600CC;
    }

    ol {
    padding: 0;
    color:#FFFFFF;
    font-family: verdana. sans-serif;
    font-size:1em;
    background-color:#6600CC
    }

    #linksli {
    display: inline;
    border-right: 1px, solid, #FFFFFF;
    margin-right: 0.5em;
    padding-right: 0.75em;
    font-weight: bold;
    }[/code]
    the html
    [html]
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-gb">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    <link rel="stylesheet " type="text/css" href="new_page_ 1.css">
    </head>
    <div id="container" >
    <div id="header">
    <body>
    <img src="images/networkartslogo .gif" alt="Logo" /><div id="links">
    <div id="linksli">
    <ol><div id="ol">
    <li>Contacts</li>
    <li>Referrals </li>
    <li>About</li>
    <li>Benefits</li>
    <li>Your Say</li>
    <li>Site Map</li>
    </ol></div>
    </div>
    </div>
    </body>
    </html>[/html]
    Last edited by drhowarddrfine; Dec 21 '07, 10:46 PM. Reason: Please use code tags
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    Once again you cannot place division outside of the body tag.......1 sec and i'll fix it.


    - Death

    Comment

    • quartzy
      New Member
      • Dec 2007
      • 18

      #3
      Do you mean that all divs are to be placed before the first body tag?

      Comment

      • Death Slaught
        Top Contributor
        • Aug 2007
        • 1137

        #4
        Originally posted by quartzy
        Do you mean that all divs are to be placed before the first body tag?
        No after

        Code:
         <body> 
        <div></div>
        <div></div>
        </body>
        Nothing to my knowledge is allowed between the head and body tag.

        Thanks, Death

        Comment

        • Death Slaught
          Top Contributor
          • Aug 2007
          • 1137

          #5
          Is this similiar to what you were going for? (To position this you will have to put it in a division, and give it an absolute position).

          [HTML] <html>
          <head>
          <style type="text/css">

          body {
          margin:0;
          padding:0;
          }

          ul {
          float:left;
          list-style-type:none;
          }

          li {
          display:inline;
          }

          a {
          float:left;
          text-decoration:none ;
          padding:0.2em 0.6em;
          color:#000;
          background-color:#fff;
          border:1px solid #000;
          }

          a:hover {
          color:#fff;
          background-color:#000;
          border:1px outset #fff;
          }

          a:active {
          color:#fff;
          background-color:#000;
          border:1px inset #fff;
          }

          </style>
          </head>

          <body>

          <ul>
          <li><a href="#">Contac ts</a></li>
          <li><a href="#">Referr als</a></li>
          <li><a href="#">About</a></li>
          <li><a href="#">Benefi ts</a></li>
          <li><a href="#">Your Say</a></li>
          <li><a href="#">Site Map</a></li>
          </ul>

          </body>

          </html>

          [/HTML]

          Hope it helps, Thanks, Death

          Comment

          • quartzy
            New Member
            • Dec 2007
            • 18

            #6
            thanks I will try it out an let you know.

            Comment

            • quartzy
              New Member
              • Dec 2007
              • 18

              #7
              Yes
              they are just like what I want but with different colors, fonts, backgrounds which I can amend, but I would rather do them in an external style sheet and not embedded like this. I'll have a go and probaly will be back, thanks

              Comment

              • Death Slaught
                Top Contributor
                • Aug 2007
                • 1137

                #8
                Originally posted by quartzy
                Yes
                they are just like what I want but with different colors, fonts, backgrounds which I can amend, but I would rather do them in an external style sheet and not embedded like this. I'll have a go and probaly will be back, thanks
                You can easily put it into an external stylesheet, I just made this way so I wouldn't have to seperate the HTML, and CSS.

                Glad it helped, Death

                Comment

                • quartzy
                  New Member
                  • Dec 2007
                  • 18

                  #9
                  hello again, they work good I placed the code in the external css and it all work good. Still have a problem with the header though.
                  Thanks for your help, css is so simple yet so hard to learn

                  Comment

                  • quartzy
                    New Member
                    • Dec 2007
                    • 18

                    #10
                    I am back again, the code worked fine in an empty page but when I added it to my external style sheet, it has gone wrong again, the links appear at the edge of the header, all jumbled up and without their boxes in firefox but work OK in ie.
                    [code=css]
                    body {
                    font-family: Verdana, sans-serif;
                    margin: 0;
                    padding: 0;
                    }
                    #container {
                    position: relative;
                    width: 65em;
                    background-color: #E60073;
                    margin-left: auto;
                    margin-right: auto; color:#000000; font-size:1em
                    }
                    #header {
                    height: 10em;
                    padding: 1em;
                    align: center;
                    }

                    img {
                    border:0;
                    width:750px;
                    height: 110px;
                    }

                    ol {
                    float: right;
                    list-style-type:none;
                    background: #6600CC;
                    }
                    li {
                    display:inline;
                    text-size: 0.5em;
                    }
                    a {
                    float: right;
                    text-decoration:none ;
                    padding:0.2em, 0.6em;
                    color:#FFFFFF;
                    background-color:#6600CC;
                    border: 1px, solid, #FFFFFF;
                    font-weight: bold;
                    }
                    a:hover {
                    color:#FFFFFF;
                    background-color:#E60073;
                    border:1px outset #FFFFFF;
                    }
                    a:active {
                    color:#FFFFFF;
                    background-color:#E60073;
                    border:1px inset #FFFFFF;
                    }
                    [/code][html]
                    </head>
                    <body>
                    <div id="container" >
                    <div id="header">
                    <a href="index.htm l"><img border="0" src="images/netoworkarts.gi f"
                    width="750" height="110"></a>
                    <ol>
                    <li><a href="contacts. htm">Contacts</a></li>
                    <li><a href="referrals .htm">Referrals </a></li>
                    <li><a href="about.htm ">About</a></li>
                    <li><a href="benefits. htm">Benefits</a></li>
                    <li><a href="say.htm"> Your Say</a></li>
                    <li><a href="sitemap.h tm">Site Map</a></li>
                    </ol></div>
                    </body>
                    </html>[/html]
                    appreciate anoyones help on this.

                    Comment

                    • quartzy
                      New Member
                      • Dec 2007
                      • 18

                      #11
                      I fixed the jumbled up problem but now I still have the problem of no border boxes, but I have them on hover.

                      Comment

                      • drhowarddrfine
                        Recognized Expert Expert
                        • Sep 2006
                        • 7434

                        #12
                        Are we just making up our own tags as we go along or are we following the standards? Validate your html and css for your list of errors that need fixing.

                        Comment

                        • quartzy
                          New Member
                          • Dec 2007
                          • 18

                          #13
                          I am learning this css and I cannot see any errors. I cannot validate it as I am developing a new website and it is not yet loaded any where. Needless to say I do not like your tone, you had to start somewhere didn't you?

                          Comment

                          • Markus
                            Recognized Expert Expert
                            • Jun 2007
                            • 6092

                            #14
                            Originally posted by quartzy
                            I am learning this css and I cannot see any errors. I cannot validate it as I am developing a new website and it is not yet loaded any where. Needless to say I do not like your tone, you had to start somewhere didn't you?
                            http://validator.w3.or g/#validate_by_in put

                            Enter your markup there and validate it.

                            And don't speak down to moderators.

                            Comment

                            • drhowarddrfine
                              Recognized Expert Expert
                              • Sep 2006
                              • 7434

                              #15
                              I wasn't following this thread, so I may have come across too strong, but I never understand how people come up with tags and attributes that don't exist. It's the third time in the last couple of days.

                              There are two validators, one for html and one for css. You don't need to be online with your site to validate. markusnoob gives the link for the html validator. Here is the CSS direct entry validator.

                              Comment

                              Working...