Page 1 of 1
Gap under images
Posted: Thu Dec 05, 2002 6:11 pm
by Mindwreck
I'm getting a roughly 1-2px tall gap underneath images that I place on pages, I've always had this problem and it bugs the hell out of me. Does anybody know any HTML or CSS tricks to get rid of this?
Posted: Thu Dec 05, 2002 6:41 pm
by mydimension
do you have an example that we can look at? it helps to know what you have already done.
Posted: Mon Dec 16, 2002 9:15 am
by onestop
Hi
You could try
<img src="MY PIC" alt="" hspace="0" vspace="0" border="0">
settting the border to 0 removes the 1px border - if you don't specify border=0 the border is still there but you can't see it
hspace=0 and vspace=0 removes any padding from the image.
All browsers handle borders hspace and vspace differently if you don't specify values.
Hope that makes sense
Andy
Posted: Mon Dec 16, 2002 5:01 pm
by mydimension
why must people spout inefficient markup? i suggest using CSS to do the same thing:
Code: Select all
img {
padding: 0px;
margin: 0px;
border: 0px;
}
Posted: Mon Dec 16, 2002 8:04 pm
by onestop
Hi
I am new to this board and I answered a question with what is valid html - the question asked if there was an HTML or css answer. I gave an html answer - I see nothing wrong in that - I apologise in advance if I misread the tone used
why must people spout inefficient markup?
I may be new to this board but I am not new to web development.
Thank You
Andy
Posted: Mon Dec 16, 2002 9:09 pm
by mydimension
pardon my momentary frustrations. they come quick and often. for the past year i have become very adamnet about using CSS for all page formating so i tend to become a bit edgy on these topics. i do apologize for my tone. it was uncalled for.
Re: Gap under images
Posted: Tue Dec 17, 2002 5:31 am
by Jay
Mindwreck wrote:I'm getting a roughly 1-2px tall gap underneath images that I place on pages, I've always had this problem and it bugs the hell out of me. Does anybody know any HTML or CSS tricks to get rid of this?
put this:
Code: Select all
<style>
.imgBlock { display:block }
</style>
...html here
<td><img class="imgBlock" src="whatever.gif" /></td>
...html continues etc...
Let me guess... you're using Netscape / Mozilla?