html - Inline style vs "inline style" . What is the difference? -


what difference between height="50" vs style="height:50px" ?

and height="50" vs style="height:50"?

i confused this.

presentation-related attributes such height="50" original way specify presentation details of html elements.

however, have since been deprecated in favour of css, via style, class , id attributes, give lot more flexibility original attributes (at least because css can extended without touching definition of html itself, of course because "cascading" part, multiple units, media-queries, , more).

you should avoid such attributes in html.

the exception html in e-mail, many clients support attributes not css versions.

note should avoid style attributes well, in favour of separate css, , class and/or id attributes. allows separate html , css, , makes easier change presentation of page without touching html (or code generates it).

also, in css (and in style attributes), must specify units (except 0), height: 50 not valid, should use height: 50px (or unit).


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -