HTML FAQs
➡️ MEDIA
Section titled “➡️ MEDIA”I’ve set a video to autoplay, but it’s not playing automatically on iOS
Section titled “I’ve set a video to autoplay, but it’s not playing automatically on iOS”For a video to autoplay on iOS, it needs to have both playsinline and muted attributes. If it still doesn’t autoplay, check that the phone is not in “Low Power Mode”, as iOS disables autoplay for all videos when this mode is active.
If I hardcode an image, should I upload it in several sizes to include them in the srcset and add sizes?
Section titled “If I hardcode an image, should I upload it in several sizes to include them in the srcset and add sizes?”Depending on the image, if it’s an icon or a small image, it’s not necessary. If it’s a background image, we should optimize it as much as possible to avoid affecting performance. If it still weighs too much and we can scale it to select the most appropriate image for each breakpoint, the ideal approach would be to scale it and include srcset and sizes.
➡️ Accessibility
Section titled “➡️ Accessibility”When should I use a button and when a link?
Section titled “When should I use a button and when a link?”Use a button when the action happens within the current page or interface, such as submitting a form, opening a modal, toggling content, or triggering JavaScript behavior. Buttons are meant for actions.
Use a link (<a>) when the user is navigating to a different page, section, or resource (either within the same site or externally). Links are meant for navigation.
When should I use a <table>?
Section titled “When should I use a <table>?”Use a <table> whenever you are working with data that is naturally structured in rows and columns, and where understanding the content depends on the relationship between those values.
If the content can be described as a dataset, a comparison, or something you would naturally represent in a spreadsheet, it should be a <table>.
Tables should be used for:
- comparisons (e.g. pricing plans, feature matrices)
- structured datasets
- schedules or timetables
- any content where column headers define the meaning of the data
Do not avoid using <table> in these cases. Replacing tabular data with <div> elements breaks semantics and makes the content harder to understand for assistive technologies.
Knowledge Check
Test your understanding of this section
Loading questions...