[Resolved] Error: Bad value 300px for attribute width on element img: Expected a digit but saw p instead.:

[Resolved] Error: Bad value 300px for attribute width on element img: Expected a digit but saw p instead.:

When you want to improve SEO score of your site or any web page then keeping w3c validation passed will also help to achieve it. You can check all your SEO attributes and consideration in lot of online free tools available.

 

I have checked it in the below link:

Check your websites SEO Issues and Possible Solutions in the below link:

iwebchk

 

Full Error:

Error: Bad value 300px for attribute width on element img: Expected a digit but saw p instead.
From line 1, column 46041; to line 1, column 46310
=”_blank”><img width=”300px” height=”250px;” data-lazy-src=”test.jpg” class=”promo_today” alt=”Deal of the day” title=”Deal of the day”> <nosc

 

Error Bad value 300px for attribute width on element img Expected a digit but saw p instead

 

 

Solution:

 

For the attributes width and height px should not be used with numbers.

So change this from,

<img width=”300px” height=”250px;” data-lazy-src=”test.jpg” class=”promo_today” alt=”Deal of the day” title=”Deal of the day”>

to:

<img width=”300″ height=”250″ data-lazy-src=”test.jpg” class=”promo_today” alt=”Deal of the day” title=”Deal of the day”>

 

Here px is removed from the width and height attribute of img tag.
I verified after removinng the px from the code, it did not create any problem in the design as well as w3 validation passed.

To validate w3 validation enter your website address in the below url

https://validator.w3.org/nu/

 

 

Thanks for reading this post! Feel free to write your comments in the below comments section.

Leave a Reply