Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The gap between two inline-block <span> element [duplicate]

Tags:

css

I created two elements together in html and made each an inline-block. I found that there was always a gap between these two elements but actually I didn't set any padding/margin attibutes for them. Could someone tell me why and how I can fix this gap?

like image 521
chaonextdoor Avatar asked Apr 18 '12 11:04

chaonextdoor


1 Answers

CSS:

span {
  display: inline-block;
}

HTML:

<span>This will have</span>
<span>a gap between the elements</span>

<span>This won't have</span><span>a gap between the elements</span>
like image 61
Juan G. Hurtado Avatar answered Oct 13 '22 04:10

Juan G. Hurtado