+ 1
what is the difference between <hr width="px" /> and <hr width="%" />?
i could not differ the px and percentage in attribute measurements,if some can tell me what is the difference and how can i use it? thank you!
3 Respuestas
+ 12
Yep, in short:
The percentage is variable, it can depends on the container size (body, div and so on), it could be helpful in responsive websites.
The pixel value is fixed, it could be helpful for set fixed value, for example in a canvas.
+ 7
Technically there's no difference, because 'width' attribute is deprecated in Html5, as almost of styling attributes which are intended to be replaced by Css styling...
However, @Maz answer is still valid for Css units, and even for 'width' html attribute, as Html is permissive and browsers are expected to correct bad syntax as well as they can (so implicitly, html 'width' attribute is corrected by being auto replaced by 'width' Css property ;) ). But it's strongly recommended to no more use html attributes for styling elements ^^
0
OK , I got it.
thank you! :p