Are there any downsides or advantages to using html property such as width="" as opposed to CSS?
example:
<img alt="" src="images/img.png" width="40%" >
vs
<img alt="" src="images/img.png" style="width: 40%;" >
When validating code W3 gives the error 'The “width” attribute on the “img” element is obsolete. Use CSS instead.'
I default to using CSS but my coworkers seem to default to the other way. Before bringing it up with them I wanted to make sure that i had my facts straight that setting the width in html is leftover from a old html version and that for future proofing and best practice we should be using CSS.
other examples are:
list type:
<ul>
<li type="none">hello</li>
</ul>
<ul style="list-style-type: none;">
<li>hello</li>
</ul>
text alignment
<p align="center">hello</p>
<p style="text-align: center;">hello</p>
*clarity : I normal use a Style Sheet however in the example for a more direct comparison I used inline styles.