Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3

Thread: Picture spacing

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    12
    Member #
    14739
    Hey,
    I first had the basic <img src="pictureurl.gif"> and then I added the link <a href="pictureurl.gif"><img src="pictureurl.gif"></a> and when I did that it gave me spaces around the pictures rather than them being all together (touching). How could I make the spaces smaller?



    Thank you:lick:

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Do you mean you have the image without the link, and then you have the image with the link? Or do you just have the image with a hyperlink around it?

    Can you post the relevant code?

  4. #3
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Do you mean borders? You can set the border to none in CSS.

    Otherwise, let me guess, did you give any whitespace (spaces, newlines) between them?

    HTML Code:
    <img src="1.jpg" />
    <img src="2.jpg" />
    <img src="3.jpg" />
    <img src="4.jpg" />
    Well, HTML converts any blocks of whitespace in HTML to spaces (like a keyboard space). That means the above code will produce spaces between the images, instead of putting them in a straight line touching.

    There are some solutions. You could just place each of them in the same line without newlines, which is fine if there aren't many.

    However, I do this:

    PHP Code:
      <img src="1.jpg" /><?php
    ?>
    <img src="2.jpg" /><?php
    ?>
    <img src="3.jpg" /><?php
    ?>
    <img src="4.jpg" />
    Since PHP doesn't recognize whitespace, then in the resulting HTML they'll all be compacted.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:59 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com