Best method to load images

0

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

<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 load this image?

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

Is it better to leave the way it is or load with the image with CSS ??

    
asked by anonymous 26.09.2018 / 01:18

1 answer

1

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

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

The rule is: if I take out the information, will the site cease to make sense, or will it make less sense? If yes, the information should be in HTML, if not the ideal would be to put it in CSS.

    
26.09.2018 / 12:39