html - CSS Line Height / H1 Font Size -


i not sure causing line-height display differently in every browser.

can give me hint on how fix it?

body {    font-family: "tahoma", sans-serif;    font-size: 13px;    margin: 0;    padding: 0;    line-height: 1.428571429;    width: 100%;    height: 100%;  }     h1, h2, h3, h4, h5, h6, p {     margin: 0;     padding: 0;  }    h1 {     font-size: 2em;  }
<h1 style="text-align:center">  <span style="font-size:18px">this textbox</span>  </h1>

it's because h1 element using browser-default font-size aren't accounting for. instance, in chrome, h1 element has default font-size of 2em - larger 18px on span element. if h1 element's font-size smaller 18px default, overall height of h1 element 25px.

to avoid this, can set h1 element's font-size initial:

h1 {     font-size: initial; } 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -