CSS Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • #1
    nah
    Quigly
    • Jan 2008
    • 3506

    CSS Problem

    HEY GUYS.

    So I'm in the process of coding for a website I've designed and I'm running into a bit of the problem. In order to code for the top navigation portion, I decided to make an unordered list of all the image parts of the nav (Home, About Us, etc.), and then display that list inline. However when I displayed the list inline I got a gap between each image as shown:



    Does anyone know how to get rid of those gaps?
    nah
  • #2
    FFR Player
    fido123
    • Sep 2005
    • 4245

    Re: CSS Problem

    First of all it would help if you posted the HTML and CSS used in [code] tags. Secondly it looks like the problem is probably your HTML not your CSS. Finally of all from looking of it it seems like you have those buttons aligned with the beginning of the cell containing your main body of text, but that row ends at the same point probably due to the table width which you won't want to change anyway. You just need to put the buttons in a wide enough area. You might just need to move a <blockquote /> tag.

    Comment

    • #3
      nah
      Quigly
      • Jan 2008
      • 3506

      Re: CSS Problem

      The only reason why that one button comes down to a second lime is due to those spaces in between the images, without the spaces all the buttons would fit onto one line.

      HTML:
      Code:
      <div id="topnav">
          	<ul>
              	        <li><a href="../home.html"><img src="../images/SAM-Website-Layout-Final_03.gif" width="100" height="53" alt="home nav"></a></li>
      			<li><img src="../images/SAM-Website-Layout-Final_04.gif" width="2" height="53" alt="header divider"></li>
      			<li><a href="../about-us.html"><img src="../images/SAM-Website-Layout-Final_05.gif" width="127" height="53" alt="about us nav"></a></li>
      		  	<li><img src="../images/SAM-Website-Layout-Final_04.gif" width="2" height="53" alt="header divider"></li>
      			<li><a href="../experience.html"><img src="../images/SAM-Website-Layout-Final_07.gif" width="149" height="53" alt="experience nav"></a></li>
      			<li><img src="../images/SAM-Website-Layout-Final_04.gif" width="2" height="53" alt="header divider"></li>
      			<li><a href="../services.html"><img src="../images/SAM-Website-Layout-Final_09.gif" width="116" height="53" alt="services nav"></a></li>
      			<li><img src="../images/SAM-Website-Layout-Final_04.gif" width="2" height="53" alt="header divider"></li>
      			<li><a href="../testimonials.html"><img src="../images/SAM-Website-Layout-Final_11.gif" width="176" height="53" alt="testimonials nav"></a></li>
      			<li><img src="../images/SAM-Website-Layout-Final_04.gif" width="2" height="53" alt="header divider"></li>
      			<li><a href="../press.html"><img src="../images/SAM-Website-Layout-Final_13.gif" width="82" height="53" alt="press nav"></a></li>
                              <li><img src="../images/SAM-Website-Layout-Final_04.gif" width="2" height="53" alt="header divider"></li>
                              <li><a href="../e-news.html"><img src="../images/SAM-Website-Layout-Final_15.gif" width="121" height="53" alt="e-news nav"></a></li>
      		</ul> 
      	</div>
      CSS:
      Code:
      #topnav	{ width:883px; margin:0 auto; }
      #topnav ul li { display:inline; }
      nah

      Comment

      • #4
        FFR Player
        fido123
        • Sep 2005
        • 4245

        Re: CSS Problem

        That's not the usual approach I'd take to something like this, especially making the width static since if you use percentages everything scales with the screen. Try making the width in your CSS something like width:80%; .

        Comment

        • #5
          nah
          Quigly
          • Jan 2008
          • 3506

          Re: CSS Problem

          I mean this is my first time coding for a site, and it seemed like a logical way to go about it. I'm really only concerned with removing the gaps in between the gaps.
          I tried setting a negative margin which got rid of the gaps, but caused everything to shift off center.
          nah

          Comment

          • #6
            FFR Player
            fido123
            • Sep 2005
            • 4245

            Re: CSS Problem

            I'd just arrange the buttons in a table. Easiest way to go about it. Everybody bitches about presentational HTML because CSS is apparently the way you should do it, but honestly I really really don't like the CSS approach. I really only use CSS to change an element's default attributes.

            Comment

            • #7
              FFR Player
              ddrking133
              • Jun 2004
              • 584

              Re: CSS Problem

              Ew tables. Don't use tables. Please.

              Can you post ALL the HTML and CSS for your entire layout.
              [/center]

              Comment

              • #8
                FFR Player
                Emithith
                • Sep 2008
                • 1784

                Re: CSS Problem

                again, touching the carcass of a dead thread.
                Watch the post date.

                Comment

                • #9
                  FFR Player
                  ddrking133
                  • Jun 2004
                  • 584

                  Re: CSS Problem

                  Whoops! Didn't see an answer just trying to help, calm down broski
                  [/center]

                  Comment

                  Working...