SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript and HTML Spacing

    Hey all,
    I was just doing a layout earlier and when I went to place the images in the code it turned out fine until I started adding the rollover links, when it seems that it's adding a 1-2px buffer on the top and bottom of the images. This is only when I'm using javascript like below.

    HTML Code:
    [color=#ffffff]<a href="contact.php">
    	 <img src="images/frlayout_02.jpg" name="cont" border=0 
    	 onMouseOver="document.cont.src='images/frlayout_02on.jpg'"
    	 onMouseOut="document.cont.src='images/frlayout_02.jpg'" alt="Contact Us"></a>[/color]
    is what it looks like (notice the right half of the main banner is shifted down because of this). Any ideas would be greatly appreciated

    -Graham

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What happens if you remove the whitespace from your code? i.e.
    Code:
    <a href="contact.php"><img src="images/frlayout...
    IE often interprets whitespace as a single &nbsp;


    Andy
    From the English nation to a US location.

  3. #3
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as far as I can tell that doesn't do anything. I was thinking it had something to do with the border property of the image and even if set to 0, it still existed as whitespace in the layout...

  4. #4
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using CSS? Any chance of seeing the rest of the page?
    From the English nation to a US location.


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
  •