Питерсайт       

Images in P tags?

Источник: https://www.sitepoint.com/community/t/images-in-p-tags/5943/2

Yes, it is OK, if the text equivalent (the value of the alt attribute) makes sense at that place in the paragraph.

Example 1

<p>If there is a known issue with the service, you will see a

<img src="/img/warning.png" alt="Warning!"> icon

in the upper right-hand corner.</p>

Example 2

<p><img src="/img/alert.png" alt="Notice! This service is temporarily out of order."></p>

If the text equivalent is empty, e.g., for a purely decorative image, it's better to use a <div>.

Example 3

<div><img src="/img/sunset.jpg" alt=""></div>

Remember: an image is nothing but an alternative representation of the information in the text equivalent (semantically). Therefore an image can be used wherever the corresponding text equivalent can be used.

Опубликовано: 23 Марта, 2018

Последнее редактирование: 23 Марта, 2018

Яндекс.Директ Google AdWords Bing Ads Amazon Product AdsHTML CSS JavaScript jQuery PHP CMS CMF MODX Wordpress Drupal ExpressionEngine htaccess SEO SEMHTML CSS JavaScript jQuery PHP CMS CMF MODX Wordpress Drupal ExpressionEngine htaccess SEO SEMЯндекс.Директ Google AdWords Bing Ads Amazon Product Ads