I have aligned a span
next to div
as shown below but there is a spacing between the elements. Can someone tell me what is causing it to appear and how to remove it?
<table>
<tr>
<td>
<div id="headerDiv" style="">DIV</div>
<span id="labelSpan">test</span>
</td>
</tr>
Using
inline-block
will create a space when elements are on a new line. (The most frustrating example is when you wantli
to be side-by-side.Either do this:
Or this:
Alternatively, you can do
float:left;
instead.JSFiddle