Do you add width and height properties to images in user controls?
Updated by Brady Stroud [SSW] 6 months ago. See history
123
<introEmbed
body={<>
Framework pages (i.e., user controls and common layout files) **should** have width and height properties specified for all images that are used. This means that the page's layout will be rendered correctly while loading and when the user has images turned off in their browser.
</>}
/>
Images that have a height and width property set can improve your page’s load times by a few milliseconds. However, this will cause problems for any responsive behaviour of the page and should be used when appropriate. It is exceedingly unusual for an image in the site layout to not be placed using CSS, so it’s likely if this rule applies to you, you should switch to CSS and background-property.
Categories
Acknowledgements
Related rules
Need help?
SSW Consulting has over 30 years of experience developing awesome software solutions.