In the early 2000s, the most common way to add video and audio to a web page was to use third-party plugins like Flash, QuickTime, or Windows Media Player. These plugins were not always reliable, and users had to install them separately, which created compatibility and security issues.
<video>
element.The
src
attribute specifies the URL of the video file that should be played, and thecontrols
attribute is a Boolean attribute that displays the browser’s built-in video controls, such as play/pause, volume, and fullscreen.
<video>
element?It’s important to have fallback content inside the
<video>
element due to browser compatibility and accessibility. Not all browsers support the<video>
element so having fallback content ensures that users can still access the content if the video fails to load or play. Also, users who are visually impaired may use screen readers to access content on the web.
<audio>
and <video>
are characters.
<audio>
and<video>
were two best friends who loved to go hiking together.<audio>
used his sound engineering skills and recorded the soothing sounds of a waterfall while<video>
was inspired by the majestic visual display of the waterfall and decided to capture it on camera. Together,<audio>
and<video>
created a multimedia experience for users.
Source
Flexbox is best suited for simpler layouts, where you need to align elements along a single axis, while Grid is ideal for complex layouts where you need to align elements in multiple rows and columns.
Grid container is an element that has been set to display: grid
. It is the parent element of all the grid items and establishes the grid formatting context.
A Grid item is any child element of a grid container that has been set to display: grid
. Each grid item is positioned within the grid container according to the grid lines.
Grid line are the lines that define the rows and columns of the grid. Grid lines are numbered starting from 1 and can be referred to using positive or negative integer values. Negative values are used to count from the end of the grid, so -1 would refer to the last row or column.
Sources
Making images responsive is an important best practice for web development, as it can improve site performance, user experience, and accessibility, and ensure that websites are accessible and usable on all devices.
<img>
attributes srcset
and sizes
. Write an example of how they are used.
Srcset
andsizes
are attributes of the<img>
element that allow developers to specify multiple image sources and sizes to ensure that the appropriate image is loaded based on the user’s device and screen size
srcset
more helpful for responsive images than CSS or JavaScript?
srcset
is more helpful for responsive images than CSS or JavaScript because it allows the browser to choose the most appropriate image for the user’s device and screen size, while also reducing the amount of data that needs to be downloaded.
Source