HTML/CSS - Do different text elements have inherently different sizing? -


a problem i've been coming across aligning text when within different elements. example of occurs here-

enter image description here

as can see, highlighted space both texts same (the grey area on right hand text), h1 element doesn't encompass highlighted area on right hand side, whilst span on left hand side encompass it, resulting in larger element (independent of styling).

i don't know causes , huge if identify cause of problem is.

firstly should reset default css of elements http://cssreset.com/ remove default margins , paddings elements. write class in style sheet , apply both elements. don't use inline styles it's confusing in long run, , makes development more dry. should set line-height match font-size like, ie 1rem 1rem or 16px 16px because depending on parent values 1rem may not equal 16px.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -