Attribute (currently in introduction to html)

Hi guys, I’m currently learning HTML, CSS & GitHub course

There’s a few questions I’m stuck with I’ve tried to research for the answers, but I still do not get the reasoning behind. Can someone help me out, please?

First question:

  1. Why can’t I just add Alt attribute into video tag, same way as image tag
    I understand the IMG tag, but for video tag I don’t. Presumably, an Alt attribute is displayed if an image doesn’t load why can’t I place it same way as IMG tag in this manner
<Video src="xxxx" width="xxxx" height ="xxxx" alt="xxxx">  </video>

Second question:

  1. Why don’t I need to specify a control attribute? Like so far all the attribute has reference e.g. width attribute, height attribute, ID attribute?

Like all the other attribute has:

  1. Width=“xxxx”
  2. height=“xxxx”
  3. ID=“xxxx”

why isn’t there a specific reference to controls

An alt attribute value is intentionally brief, and succinct. That is possible only when the image it describes is static. What is static about a video? There is no adequate alternate text that can describe something that takes minutes to play out for a sighted user. It makes no sense to have an alt attribute on a <video/video> element when we take this into account.

Hi mtf so is it okay to presume this reasoning:

  • Alt attribute is used to describe only static(not moving) images. Used in case an image doesn’t load or for visual impaired
  • However, video is constantly playing, It is not static
  • An example is a collage of pictures in a form of video, how do you know what image is what based on a single Alt attribute
  • Hence, no adequate alternate text that can describe something that takes minutes to play out for a sighted user. It makes no sense to have an Alt attribute on a <video/video> element when we take this into account

Is this correct?

Likewise, I have a question about control attribute.

So far all the attribute has values representing it except for control. When looking up, it mentions it being a boolean attribute, which I don’t quite understand. How does ‘true’ ‘false’ boolean attribute works in HTML?

Pretty confusing… would appreciate if you can aid me in clearing my question

Cheers!

Assuming you agree, pretty much.

The mere presence of the attribute is enough. If present, show controls. If not present, don’t show controls.

thank you mtf like so much bless you :slight_smile:

1 Like