Best method for uploading images

Asked

Viewed 37 times

0

I have an AMP page that I load the logo image by inserting the link inside the img tag, so:

<amp-img src="//i2.wp.com/www.meusite.com.br/wp-content/uploads/lgootipo.png" alt="logotipo" width="356" height="137">

However, what would be the best practice to upload this image ?

I thought of calling the picture with the background-image: url("...") within the tag style

It will be better to leave it the way it is or load the image with CSS ??

  • If you are concerned about Performance x Quality your answer is here: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization

1 answer

1


HTML should contain information that is semantically relevant to your site, and CSS should offer information that is stylistic (decorative).

Various types of readers will completely ignore the CSS, and you don’t want them to ignore the logo. In other words, the logo has semantic relevance to the site, which is why it has the attribute "alt", in case the reader can not see the image (I suggest that you improve your "alt", describing the appearance of the logo).

The rule is, if I take the information out, will the site stop making sense, or will it make less sense? If yes, the information should be in HTML, if not ideally put it in CSS.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.