I put an image inside the a tag. but when i gave border to the image and a tag. The A tag taking some extra space. it is not surrounding the image.how to overcome those extra space by 'a' tag. i am indicating a tag in red line.
My html:
<a href="#"><img src="http://img165.imageshack.us/img165/1043/burnhr6.png"/></a>
Css:
img
{
border:1px solid black;
}
a
{
border:1px solid red;
}
http://jsfiddle.net/rEPXY/2/
Approach 1: We can remove space between any two tags by simply using margin-bottom property. The margin-bottom property sets the bottom margin of an element. We will assign a negative value to the margin-bottom of a particular tag to eliminate the extra space between the tags as shown.
You can use the HTML entity to create blank spaces in both paragraph text and text in tables, for example. Since there is no blank space keyboard character in HTML, you must type the entity for each space to add.
It turns out that's pretty simple: just use the line-height CSS property and then apply it. I have an example below. Then, you can apply that CSS class to your HTML. Now, the space between the lines changes.
A non-breaking space prevents line breaks from occurring at a particular point in an HTML document. To use a non-breaking space, you would use the following: For example, if you wanted the words "Mr."
Is something like this what you are looking for?
a
{
border:1px solid red; display:inline-block; line-height:0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With