1

Take the following example:

span {
  color: blue;
  border: 1px solid blue;
  font: 9px Arial;
  font-weight: bold;
}
<span>LOREM IPSUM</span>
<span>LOREM IPSUM</span>
<span>LOREM IPSUM</span>
<span>LOREM IPSUM</span>

Browsers will add some inconsistent margins/paddings between the border and the text:

Firefox:

  • 2px top and bottom
  • 1px left
  • 0px right

Chrome:

  • 1px left, top and right
  • 2px bottom

Resetting margin and/or padding to 0 does nothing. Is there anyway to get this more consistent between browsers? Preferably, with all sides having the same margin?

rfgamaral
  • 16,546
  • 57
  • 163
  • 275

1 Answers1

-1

You could try using different prefixes like below for example:

.someDiv {
   height: 19px; // probably your code
   -webkit-height:19px; // for chrome and safari
   -o-height:19px; // for opera
   -moz-height:19px; // for firefox
}
joshsisley
  • 310
  • 2
  • 11