Is the alt attribute mandatory on img elements? If not, can you describe a scenario where it can be set to an empty value? Does an empty value affect accessibility in any way?
Answer / chaitu
The alt attribute is mandatory on img elements but its value can be empty (i.e. alt=""). An empty value is recommended when the image shown is used for decorative purposes only and therefore isn’t part of the content of the page. With regards to accessibility, if the alt attribute is empty, screen readers will ignore the image.
This is highly recommended because using a value of something like “Content separator” will only disturb the user when this text is spoken.
Is This Answer Correct ? | 0 Yes | 0 No |
Is the alt attribute mandatory on img elements? If not, can you describe a scenario where it can be set to an empty value? Does an empty value affect accessibility in any way?
Can you describe why hgroup was dropped and how the markup can be addressed today with an example?
Is it possible to express a date range using a single time element?
What is the mark element? Can you describe an example of use for this element?
How do I link to a location in the middle of an HTML document?
What’s the difference between the meter element and the progress element?
Explain marquee tag.
How to create a button which acts like a link?
Describe when it’s appropriate to use the small element and provide an example?
How to create nest tables within tables in HTML?
Which network design layer provides a connection point for end user devices to the network? access core distribution networkby a networking device
Consider the following markup: <figure> <picture> <source media="(min-width: 40em)" srcset="large.jpg 1024w, medium.jpg 640w, small.jpg 320y"> <img src="medium.jpg" alt="London by night"> </picture> <figcaption>A landscape of London by night</figcaption> </figure> Is it valid? If not, can you explain why?