4 Replies Latest reply on Feb 4, 2010 5:04 AM by GD WebDev

    Space Between images

    GD WebDev

      Hi,

       

      I've built an horizontal menu across the page and i'm looking to put a around a 2pixel space between each image, i dont want to use the usual break &nbsp, in which case i have tried putting HSPACE="2" in the image tags. This works fine, however its putting a space to both the left and right of the image, when really all i want is a space 2pixel space to the right of the image.

       

      I hope that make sense.

      Thanks in advance

        • 1. Re: Space Between images
          osgood_ Level 8

          Got any code that we can view? Using HSPACE is not the way to contol the distance between items.

          • 2. Re: Space Between images
            GD WebDev Level 1

            <div id="Menu"><img src="images/menu/home_on.jpg" width="100" height="30" /> <img src="images/menu/whoweare.jpg" width="144" height="30" /> <img src="images/menu/forsale.jpg" width="144" height="30" /> <img src="images/menu/forrent.jpg" width="111" height="30" /> <img src="images/menu/otherservices.jpg" width="161" height="30" /> <img src="images/menu/login.jpg" width="90" height="30" /></div>

            • 3. Re: Space Between images
              osgood_ Level 8

              Are you familar with css?

               

              If so just adding this to your css style sheet will work:

               

              #Menu img {
              margin-right: 2px;

              }

               

              or if you dont have a css stylesheet attached to the page it can go in the 'head' section of your pages code, directly before the closing </head> tag as below:

               

              <style type="text/css">
              #Menu img {
              margin-right: 2px;
              }

              </style>
              </head>

              • 4. Re: Space Between images
                GD WebDev Level 1

                Yes i had an external style sheet in place.

                 

                That did the trick, spot on!

                 

                Thanks for your help.