Go Back   AskDamageX.com Webmaster Forum > General > Webmaster Business & Traffic Main Discussion

Reply
 
LinkBack Thread Tools
Old July 29th, 2010, 11:23 PM   #1 (permalink)
Who does #2 work for?
 
AmateurFlix's Avatar
 
Join Date: Oct 2005
Posts: 13,986
Default CSS question regarding line spacing

Can anyone tell me why the first 4 links in this code have a different line spacing than the last 4?

Code:
<html> 
<head> 
<style type="text/css">
.paysites a {text-decoration: none; font: 12px Arial, Verdana; color: #0000FF;}
.paysites a:hover {text-decoration: underline; color: #FF0000;}
</style>
</head> 
<body>
<TABLE class=paysites BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="100%" ALIGN="CENTER">
<TR>
<TD>

<IMG SRC="" HEIGHT=10 WIDTH=10 BORDER=0 ALT="">&nbsp;<a href="http://domain.com" target="_blank">anchor text</a><BR>
<IMG SRC="" HEIGHT=10 WIDTH=10 BORDER=0 ALT="">&nbsp;<a href="http://domain.com" target="_blank">anchor text</a><BR>
<IMG SRC="" HEIGHT=10 WIDTH=10 BORDER=0 ALT="">&nbsp;<a href="http://domain.com" target="_blank">anchor text</a><BR>
<IMG SRC="" HEIGHT=10 WIDTH=10 BORDER=0 ALT="">&nbsp;<a href="http://domain.com" target="_blank">anchor text</a><BR>
<a href="http://domain.com" target="_blank">anchor text</a><BR>
<a href="http://domain.com" target="_blank">anchor text</a><BR>
<a href="http://domain.com" target="_blank">anchor text</a><BR>
<a href="http://domain.com" target="_blank">anchor text</a><BR>

</TD>
</TR>
</TABLE>
</body>
</html>
When I put an <img> tag on a line, it generates extra space between the lines, even though the img is only 10px high and the font is 12px. It doesn't matter if I reduce the img to 1 pixel high, it still does this. I tried specifying line-height, however that was ignored for lines containing img's.

Last edited by AmateurFlix; July 29th, 2010 at 11:29 PM. Reason: this wasn't just happening in IE, it does the same in FF
AmateurFlix is offline   Reply With Quote
Old July 30th, 2010, 12:32 AM   #2 (permalink)
from accounting
 
Join Date: Oct 2005
Location: California
Posts: 16,507
Default

Because of the non-breaking space after the image.
__________________
Hosting for ADX provided by Swiftwill
CraK is offline   Reply With Quote
Old July 30th, 2010, 08:15 AM   #3 (permalink)
Who does #2 work for?
 
AmateurFlix's Avatar
 
Join Date: Oct 2005
Posts: 13,986
Default

thanks CraK, if I just include some blank space within the image, that should achieve the look I want.
AmateurFlix is offline   Reply With Quote
Old July 30th, 2010, 11:11 AM   #4 (permalink)
from accounting
 
Join Date: Oct 2005
Location: California
Posts: 16,507
Default

You can just use CSS to do that once the non-breaking space is taken out.

img {margin: 0 5px 0 0;}
__________________
Hosting for ADX provided by Swiftwill
CraK is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -7. The time now is 07:39 AM.



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0