Câu hỏi phỏng vấn HTML
Câu hỏi

What is the purpose of the alt attribute on images?

Câu trả lời

The alt attribute, also known as "alt text" or "alt description," serves several important purposes when used with images in HTML:

  1. Accessibility: The primary purpose of the alt attribute is to provide a text alternative for images to users who are unable to see them. This includes people with visual impairments who may use screen readers to interpret and navigate the web. The alt text is read aloud to these users, allowing them to understand the content that the image conveys[1][2][4].

  2. Fallback Content: When an image fails to load on a webpage, due to issues like incorrect image paths, slow internet connections, or if the user has chosen to disable images in their browser, the alt text will be displayed in place of the image. This helps maintain the context and provides information about what the image is supposed to be, even when the visual element is not present[2][3].

  3. SEO (Search Engine Optimization): Search engines cannot interpret images directly but can read the alt text associated with them. This text helps search engine crawlers to understand the content of the image, which can contribute to the image's proper indexing and ranking in search results. Consequently, well-...

entry

entry

Gợi ý câu hỏi phỏng vấn

senior

What is an HTML preprocessor and are you using it?

junior

What were some of the key goals and motivations for the HTML5 specification?

senior

What are the building blocks of HTML5?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào