Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extra spacing after an A Tag/img tag?

Hello i'm trying to build a table cell using div tag and while doing so. i get this extra spacing after my img a tag within the cell.

<div display:table>
 <div display:row>
  <div display:tabel-cell>
   <a><img/></a>

I can't seem to figure out how to get rid of that extra spacing.

i tried display:inline for the a and img tag. yet not luck.

if anyone can help me get rid of this spacing i would gladly appreciate it.

Example -- right before the shadowing there a 2-3 pixel white space within this tabel-cell

http://i.imgur.com/DLPWH.png

like image 684
Tom Avatar asked Oct 11 '11 22:10

Tom


People also ask

Can a tag have a space?

Spaces are not allowed in tags – create compound tags using hyphens rather than spaces (like [visual-studio] ) rather than multiple tags separated by spaces ( [visual] [studio] ).

How do you put a space between two tags?

The simplest way to add a space in HTML (besides hitting the spacebar) is with the non-breaking space entity, written as &nbsp; or &#160;. Multiple adjacent non-breaking spaces won't be collapsed by the browser, letting you “force” several visible spaces between words or other page elements.

How do I space out an image in HTML?

Usually, it is preferable to have a little space between the image and the surrounding text. In HTML, you provide this space by using the vspace and hspace attributes within the img element. In CSS, to align an element with no text wrap, apply the text-align property to a block-level element that contains the image.

Which tag is used to add space around the image?

The <img> tag creates a holding space for the referenced image.


2 Answers

Aside from the fact that you should use tables for tabular data, I think that setting display: block on the image will remove the space. If that doesn' work, try to make a jsFiddle page to show off the problem.

like image 57
deviousdodo Avatar answered Oct 08 '22 06:10

deviousdodo


That space can be removed using:

style="display:block;"
like image 33
Andrei Maxwel Avatar answered Oct 08 '22 05:10

Andrei Maxwel