0

I would need to get rid of the space below the two span tags and don't understand what causes them to be there.

HTML

<div>
  <span></span><span></span>
</div>

CSS

div {
  border: 1px solid gray;
  display: inline-block;
}
span {
  width: 13px;
  height: 25px;
  display: inline-block;
}
span:not(:last-child) {
  border-right: 1px solid gray;
}

Screenshot:

Screenshot of the issue

https://jsfiddle.net/wjy5hxnu/

M3RS
  • 6,720
  • 6
  • 37
  • 47

2 Answers2

1

You can check the updated jsfiddle here.

div {
  font-size: 0px;
}

Adding font-size: 0 to div will solve the problem and if you have to use any text inside span you can add font-size directly in the span.

M3RS
  • 6,720
  • 6
  • 37
  • 47
Sonia
  • 1,909
  • 1
  • 11
  • 13
-1
div {
  border: 1px solid gray;
  display: inline-block;
  line-height: 11px;
}

Line height will lower the div to meet the line.

spas2k
  • 499
  • 1
  • 6
  • 15