Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE Puts Space and Underscore between Images 2

Status
Not open for further replies.

xyzuser

Technical User
Aug 13, 2008
96
US
I have two images next to each other. When I have just image01, I do not get an underscore next to it. When I put image02 next to it, IE inserts a space with an underscore between the images.
Code:
<A href="Music/Song01.wav">
<IMG  src="images/Image02.jpg" border="0" vspace="50"> 
<IMG  src="images/Image01.jpg" border="0"></a>
I am using a :link pseudo-class with
Code:
 TEXT-DECORATION: none;  text-underline: none;
This does not happen in Firefox - I get neither the space between the images nor the underscore. It happens only in IE.

I am circumventing this by putting a separate href for each image instead of a single href covering both images. So I do get rid of the underscore. But IE is still putting in the space between the images.

Is there way to make IE work right so that:

(1) I don't get the space between the images
(2) I don't need to code the href twice to eliminate the underscore in the space.

Thanks
 
Well, now putting two hrefs no longer eliminates the underscore. I was trying different things and when I put it back to the way I had circumvented the underscore before (two hrefs instead of one href) that circumvention no longer works. So even with two hrefs I have both a space between the images and an underscore (in IE only - Forefox is still OK) I don't know why the circumvention worked before (for the underscore) and does not work now. In any case, I would appreciate any help in eliminating (in IE) the space and the underscore.
Thanks
 
Check out this. Use of very old and deprecated code is often a cause of problems.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
The space between the images comes from different interpretations of white-space. IE6 believes that you wanted to have a space between the images, because you put a return between them -- html, being white-space agnostic interprets and number of spaces or returns as single space. FF on the other hand thinks that your return was there simply to make your code more readable. If you put both image tags on a single line without any spaces between them, both browsers should show them without any spaces. As for the underscore, I am not sure how that came about, but I would expect it to go away when the space is gone.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
I found another which works a lot of the time... if you have images inside a container with no text, you can use this:

Code:
#myImgContainer {
   font-size: 1px;
}

...

<div id="myImgContainer">
   <img ... />
   <img ... />
   <img ... />
</div>

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Thanks (and a star, of course) Vragabond. That was exactly the problem and now it displays properly. And the underscore is gone.

BillyRayPreachersSon - I did not try your method, as Vragabond's worked, but I appreciate your help (star, too).

ChrisHunt - Thanks for your suggestion but when I tried that layout IE and Firefox were not at all happy with it and displayed the second IMG HTML as text.
 
Hi

Chris' suggestion is usually written as :
Code:
<IMG  src="images/Image02.jpg" border="0" vspace="50"
><IMG  src="images/Image01.jpg" border="0">
But probably will not solve your original problem.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top