Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with top Navigation bar for site

    Hey,

    The site I am making I want a navigation bar with links like home, gallery etc. I made it with slices in photoshop but when i put it into the html code (using tables) it leaves spaces between each slice and then it doesnt all fit in the right area.

    heres the code:

    Code:
    <table width="810" cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="white">
    <tr>
    <td height="40" colspan="2">
    <a href="index.html"><img border="0" src="images/nav-bar/nav-bar_01.gif" alt="Home" height="40"></a>
    <a href="projects.html"><img border="0" src="images/nav-bar/nav-bar_02.gif" alt="Projects" height="40"></a>
    <a href="forum.html"><img border="0" src="images/nav-bar/nav-bar_03.gif" alt="Forums" height="40"></a>
    <a href="gallery.html"><img border="0" src="images/nav-bar/nav-bar_04.gif" alt="Gallery" height="40"></a>
    <img border="0" src="images/nav-bar/nav-bar_05.gif" alt="navbar" height="40">
    </td>
    </tr>
    </table>
    Thats the code for the nav bar but how can i get all the images to stick right to each other?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Use a list instead.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    body {
    margin:0;
    padding:0;
    background:#000000;
    color:#FFF;
    }
    #nav {
    margin:0 auto;
    padding:0;
    list-style-type:none;
    line-height:0px;
    font-size:0;
    height:40px;
    background:#FFF;
    color:#000;
    width:810px;
    }
    #nav li {
    float:left;
    }
    </style>
    </head>
    <body>
    <ul id="nav">
    	<li><a href="index.html"><img border="0" src="images/nav-bar/nav-bar_01.gif" alt="Home" height="40"></a></li>
    	<li><a href="projects.html"><img border="0" src="images/nav-bar/nav-bar_02.gif" alt="Projects" height="40"></a></li>
    	<li><a href="forum.html"><img border="0" src="images/nav-bar/nav-bar_03.gif" alt="Forums" height="40"></a></li>
    	<li><a href="gallery.html"><img border="0" src="images/nav-bar/nav-bar_04.gif" alt="Gallery" height="40"></a></li>
    	<li><img border="0" src="images/nav-bar/nav-bar_05.gif" alt="navbar" height="40"></li>
    </ul>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    when i did the list and css style thing the rest of the site got sorta distorted, it spaced out my main area and the nav bar wasnt alligned properly


  •  

    Posting Permissions

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