html - Inline style vs "inline style" . What is the difference? -
this question has answer here:
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
Post a Comment