score:22

Accepted answer

images should have an alt property. the alternate property comes into picture in several cases like the card not getting downloaded, incompatible browsers, or the image getting corrupt. you need to pass in a prop called alt to the image.

also, alt tag is used by screen readers for visually impaired. therefore it is considered as a good practice to always add a alt tag to the image component. accessibility

score:0

try this one :

<input type="image" img src = {'url'} alt="photo" />

(i have used `` not the single quotation marks for the url)

score:0

i had this an error when using eslint in react for this:

<img src={frontdefault} />

add this

alt=''

this is how it must be for it to work

<img src={frontdefault} alt='' />

score:0

in my case, this error was inside the react, and it happened because it was like this, <img src={{redled} } style={{width:'50px'}}/>, that way i was giving this error. the error was that i put two braces around the img call and i only needed one brace like that, <img src={redled} style={{width:'50px'}}/>

score:0

the element includes the alt property, which will prevent the image from having any alternate text,`

score:0

this error means that you haven’t added the "alt" property. this property is mandatory, so you can not ignore it.

to get rid of this error you should set the alt attribute and pass some text there. it's like a description of your photo. this text will be used in cases when your picture is not loaded or when browser couldn't find your image by provided path (src attribute).

<img src="path_to_your_image" alt="alternative_text_of_your_image"/>

score:1

in the alt attribute do not put the image or image because those words are reserved for react

score:6

it means that your image need a description and this is a property in the img tag called alt so use this as long as you write in jsx & react :

<img src={imageimported} alt="description of image"/>

score:7

i had a similar error with this code.

    <img src={props.contacts.imgurl}/>

solution: notice the alt= position on the image anchor outside the curved parenthesis

    <img src={props.contacts.imgurl} alt=""/>

score:8

i had the same error. basically, you should not include these words in alt attribute. image or picture, or photo

// avoid using image or picture, or photo


// do
<img src="foo" alt="nice"/>.      // good


// don't
<img src="foo" alt="foo is coming "/>.    // bad

score:12

it means that your <img> tag must have an alt attribute on it like so:

<img src="pathtoyourimage.extension" alt="my awesome image">

in case if the image isn't loaded then the text inside the alt attribute will be shown instead.

score:34

it means when you create an image in your html, you should include an alt attribute for the benefit of screen readers and text browsers.

<img src="url" alt="description of image">

Related Query

More Query from same tag