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-
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
Post a Comment