What is the difference between the href and src attributes in HTML?
href is used for images and videos, while src is used for hyperlinks.
href specifies the destination URL for hyperlinks, while src specifies the source
URL for images,
videos, and other embedded content.
Both href and src can be used interchangeably for all types of resources.
href is used for external resources, and src is used for internal resources.
True or False Question
The <img> tag in HTML is used to display an image, and it must have a "src" attribute to
specify the image's source. True
Adding the "autoplay" attribute to the <audio> tag will always play the audio file as soon
as the page loads. True
The "alt" attribute of the <img> tag is optional and is only required if the image contains
critical information. Falsealt 属性包含一条对图像的文本描述,这不是强制性的
The "controls" attribute on the <video> tag provides users with a built-in player to control
playback, such as play, pause, and volume. True
Hyperlinks created with the <a> tag can only link to other webpages and cannot be used for in-page
navigation. False可以链接到页面内的锚点(如 href="#section1")
The "src" attribute of the <video> tag must point to a video file that is compatible with
the user's browser. True
To create a hyperlink that opens in a new browser tab, the "target" attribute should be set to
"_blank". True
The "autoplay" and "muted" attributes can be combined in the <video> tag to
automatically play the video silently. True
The "alt" attribute of the <img> tag is primarily used for improving accessibility and SEO,
rather than displaying alternative content when the image fails to load. False
The <source> tag is typically nested inside the <audio> or <video> tag to specify
different media files for different browser compatibility. True
<img> is a block level element, while <video> is an inline element.
Falseimg是inline, video是block
Definition of Term
Multimedia
Any media which can carry information, such as text, image, video, audio and so on.