Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: CSS navigation

  1. #1
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation CSS navigation

    Hi, im new to css but not that much to HTML. I created a navigation for my site, but how do I make the text in my site be to the right of my navigation, not below it? I tryd this:


    (navigation code bla bla bla)
    <div align="right">
    This is my site text.
    </div>

    But It just still appeared below the navigation. Any suggestions?

  2. #2
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    To make DIVs appear next to each other in CSS you use:

    Code:
    <div id="containter">
    <div id="div1"></div>
    <div id="div2"></div>
    <div id="div3"></div>
    </div>
    Code:
    div#container {
    width: 300px;
    height: 20px;
    }
    
    div#div1, div#div2, div#div3 {
    width: 100px;
    height: 20px;
    float: left;
    }
    Or you can use <div class="div"></div> and .div {. That should align them, and do what you asked. Unless I misunderstood, let me know.

    Tim

  3. #3
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Wow thanks. none of the online HTML tuts told me that. Thanks.

  4. #4
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    So did that answer your question?

  5. #5
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Well actually, if my navigation div already has "id=navigation" can a div have 2 ID's?

    EDIT:Nevermind
    Last edited by Nailgunpro; 02-23-2008 at 04:26 PM. Reason: mistake

  6. #6
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    No, can you post your CSS and page? I can tell you what to do if I see it.

  7. #7
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <style type="text/css">
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */
    
    .arrowlistmenu{
    width: 180px; /*width of menu*/
    }
    
    .arrowlistmenu .headerbar{
    font: bold 14px Arial;
    color: white;
    background: black url(media/titlebar.png) repeat-x center left;
    margin-bottom: 10px; /*bottom spacing between header and rest of content*/
    text-transform: uppercase;
    padding: 4px 0 4px 10px; /*header text is indented 10px*/
    }
    
    .arrowlistmenu ul{
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
    }
    
    .arrowlistmenu ul li{
    padding-bottom: 2px; /*bottom spacing between menu items*/
    }
    
    .arrowlistmenu ul li a{
    color: #A70303;
    background: url(http://nailgunpro.468mb.com/arrowbullet.png) no-repeat center left; /*custom bullet list image*/
    display: block;
    padding: 2px 0;
    padding-left: 19px; /*link text is indented 19px*/
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid #dadada;
    font-size: 90%;
    }
    
    .arrowlistmenu ul li a:visited{
    color: #A70303;
    }
    
    .arrowlistmenu ul li a:hover{ /*hover state CSS*/
    color: #A70303;
    background-color: #F3F3F3;
    }</style>
    <div class="arrowlistmenu" id="div1">
    <h3 class="headerbar">-Main</h3>
    <ul>
        <li><a href="http://www.nailgunpro.468mb.com/">Home</a> </li>
        <li><a href="http://http://www.nailgunpro.468mb.com/movies.htm">Movies</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/games.htm/">Games</a> </li>
        <li><a href="http://http://www.nailgunpro.468mb.com/mymovies.htm">Our Movies</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/news.htm">News</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/sponsors.htm">Sponsors</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/guestbook.htm">Guestbook</a> </li>
    </ul>
    </div>
    <div id="div2">Welcome to the official Nailgun Productions homepage! </div>
    Edit: Wrapped code in [code] tags.
    Last edited by tech_support; 02-27-2008 at 04:34 AM.

  8. #8
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Next time you should use the [code] tags

    First, do you have a normal page?

    As in:
    Code:
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>
    or is your entire page simply what you posted?

  9. #9
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    well now I added those tags (i forgot before) but it still doesnt work.

    Heres what i have now.

    Code:
    <style type="text/css">
    
    
    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */
    
    .arrowlistmenu{
    width: 180px; /*width of menu*/
    }
    
    .arrowlistmenu .headerbar{
    font: bold 14px Arial;
    color: white;
    background: black url(media/titlebar.png) repeat-x center left;
    margin-bottom: 10px; /*bottom spacing between header and rest of content*/
    text-transform: uppercase;
    padding: 4px 0 4px 10px; /*header text is indented 10px*/
    }
    
    .arrowlistmenu ul{
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
    }
    
    .arrowlistmenu ul li{
    padding-bottom: 2px; /*bottom spacing between menu items*/
    }
    
    .arrowlistmenu ul li a{
    color: #A70303;
    background: url(http://nailgunpro.468mb.com/arrowbullet.png) no-repeat center left; /*custom bullet list image*/
    display: block;
    padding: 2px 0;
    padding-left: 19px; /*link text is indented 19px*/
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid #dadada;
    font-size: 90%;
    }
    
    .arrowlistmenu ul li a:visited{
    color: #A70303;
    }
    
    .arrowlistmenu ul li a:hover{ /*hover state CSS*/
    color: #A70303;
    background-color: #F3F3F3;
    }</style>
    <div class="container">
    <div class="arrowlistmenu" id="div1">
    <h3 class="headerbar">-Main</h3>
    <ul>
        <li><a href="http://www.nailgunpro.468mb.com/">Home</a> </li>
        <li><a href="http://http://www.nailgunpro.468mb.com/movies.htm">Movies</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/games.htm/">Games</a> </li>
        <li><a href="http://http://www.nailgunpro.468mb.com/mymovies.htm">Our Movies</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/news.htm">News</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/sponsors.htm">Sponsors</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/guestbook.htm">Guestbook</a> </li>
    </ul>
    </div>
    <div id="div2">Welcome to the official Nailgun Productions homepage! </div>
    </div>
    <div></div>

  10. #10
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    First, you should have your <style> tags in the <head> of the page, and you never began the style tag.

    Code:
    ....
    </style>
    but there is no <style> in the code you gave me.

    Here
    Code:
    <html>
    <head>
    <style>
    /*Credits: Dynamic Drive CSS Library */
    /*URL: http://www.dynamicdrive.com/style/ */
    
    .arrowlistmenu {
    width: 180px; /*width of menu*/
    float: left;
    }
    
    .arrowlistmenu .headerbar{
    font: bold 14px Arial;
    color: white;
    background: black url(media/titlebar.png) repeat-x center left;
    margin-bottom: 10px; /*bottom spacing between header and rest of content*/
    text-transform: uppercase;
    padding: 4px 0 4px 10px; /*header text is indented 10px*/
    }
    
    .arrowlistmenu ul{
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
    }
    
    .arrowlistmenu ul li{
    padding-bottom: 2px; /*bottom spacing between menu items*/
    }
    
    .arrowlistmenu ul li a{
    color: #A70303;
    background: url(http://nailgunpro.468mb.com/arrowbullet.png) no-repeat center left; /*custom bullet list image*/
    display: block;
    padding: 2px 0;
    padding-left: 19px; /*link text is indented 19px*/
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid #dadada;
    font-size: 90%;
    }
    
    .arrowlistmenu ul li a:visited{
    color: #A70303;
    }
    
    .arrowlistmenu ul li a:hover{ /*hover state CSS*/
    color: #A70303;
    background-color: #F3F3F3;
    }
    
    .container {
    width: 300px;
    }
    
    div#welcome {
    width: 120px;
    height: 20px;
    float: left;
    }
    </style>
    </head>
    <body>
    <div class="container">
    <div class="arrowlistmenu">
    <h3 class="headerbar">-Main</h3>
    <ul>
        <li><a href="http://www.nailgunpro.468mb.com/">Home</a> </li>
        <li><a href="http://http://www.nailgunpro.468mb.com/movies.htm">Movies</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/games.htm/">Games</a> </li>
        <li><a href="http://http://www.nailgunpro.468mb.com/mymovies.htm">Our Movies</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/news.htm">News</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/sponsors.htm">Sponsors</a> </li>
        <li><a href="http://www.nailgunpro.468mb.com/guestbook.htm">Guestbook</a> </li>
    </ul>
    </div>
    <div id="welcome">Welcome to the official Nailgun Productions homepage!</div>
    </div>
    </body>
    </html>
    Its not pretty, but some margins should fix that Adapt everything as needed.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •