1. What are the HTML media elements?
HTML media elements are used to present the audio and video.
Some of the HTML media elements are:
- HTML audio element:
The HTML
Example:
The HTML
It is commonly used to give the same media content in multiple file formats for providing compatibility across different browsers.
The HTML
- HTML video element:
The HTML
Example:
2. How to embed an HTML document into another HTML document?
We can embed another HTML document within the current HTML document using the HTML
Example:
The HTML
3. How to insert a video into the HTML document?
We can insert a video to the HTML document using:
- HTML video element
The HTML
- The HTML srcattribute specifies the URL/path of the media resource (e.g. video).
- The HTML typeattribute specifies the type/format of the media resource(e.g. video/mp4)
- HTML iframe element
The HTML
To have the embed link of the YouTube video, follow these simple steps:
- Open the video on YouTube and click the share button.
- Open the Embed code.
- Copy the value of the srcattribute and paste it into the value of the HTMLsrcattribute of our HTMLiframeelement.
We used Boostrap Utility Embed to insert a video in Tourism Website. It also internally uses the HTML
4. How to set controls in HTML video element?
The HTML
Video controls include:
- Play
- Pause
- Seeking
- Volume
- Fullscreen toggle
- Captions/Subtitles (when available)
- Track (when available)
Example:
5. What is the use of an HTML iframe element?
Some of the uses of HTML
- We can embed HTML documents within the current HTML document
- We can embed videos within the current HTML document, etc.
6. What is an HTML picture element?
The HTML
It can contain zero or more
Example:
- The HTML srcsetattribute specifies the alternative source/ path of theimgelement.
- The HTML mediaattribute specifies the media query. CSS properties will be applied based on the device type and media features likemin-width, etc.
7. What are HTML Semantic Elements?
The word semantic means relating to meaning in language.
So, the HTML semantic elements describe the meaning of content in between the start and end tags.
There are around a hundred semantic elements. Some of them are:
Header element
The HTML
Generally, it contains heading elements, search form, logos, etc.
Example:
Nav element
The HTML
Example:
Main element
The HTML
Example:
Article element
The HTML
It can be used to represent a magazine, newspaper article, blog entry or any other independent item of content.
Example:
Section element
The HTML
It is generally used to group content that has a heading.
Example:
Aside element
The HTML
It specifies the content of less importance.
It is generally used to represent sidebars or call-out boxes.
Example:
Footer element
The HTML
It generally contains information about the author of the section, copyright data, or links to related documents.
Example:
8. What are the uses of Semantic HTML?
Some of the uses of Semantic HTML are:
Accessibility: It makes web pages accessible for mobile devices and people with disabilities as well. This is because screen readers and browsers can understand the code better.
Search Engine Optimization: It improves the website Search Engine Optimization Rankings which increases the number of people that visit our webpage.
Easy to Understand: It makes our code more readable and easier to understand.
9. What are HTML non-semantic elements?
The HTML non-semantic elements don't have any meaning.
Examples:
We cannot exactly find out the type of content within the given element unlike semantic elements like
10. What are the differences between HTML semantic and non-semantic elements?
semantic | non-semantic |
---|---|
semantic elements have the meaning | non-semantic elements don't have the meaning |
They describe the content they contain | They can contain anything |
11. What are Global attributes?
Global attributes are attributes common to all HTML elements.
They can be used on all elements, though they may not affect some elements.
Examples:
12. What are HTML selected and multiple attributes?
Selected Attribute:
It is a boolean attribute. It specifies that an option should be pre-selected when the page loads.
Example:
Multiple Attribute:
It is a boolean attribute. It specifies whether the user is allowed to provide more than one value in an input field.
It can be used in the HTML
Example:
13. What is an HTML required attribute
The HTML
If present, it specifies that an input field must be filled out before submitting the form.
Example:
14. What is an HTML html element?
The HTML
It is a container for all the other HTML elements.
15. What are the HTML formatting elements?
The HTML formatting elements are used to format the text.
Some of them are:
Element | Description |
---|---|
b | It is used to bold the text |
strong | It bolds the text and is used to tell the browser that the text is important |
i | It is used to make the text italic |
em | It makes the text italic and is used to tell the browser that the text has to be emphasized |
mark | It is used to mark or highlight a text for special interest or reference purposes |
small | It is used to display the smaller text especially for copyrights and side-comments |
del | It is used to display the deleted content |
ins | It is used to display the additional content |
sub | It is used to subscript a text |
sup | It is used to superscript a text |
16. What are HTML entities?
HTML entities are strings that start with an ampersand (
These are used to display the reserved characters (characters that are part of the HTML code.
Character | Entity | Note |
---|---|---|
& | & | Treated as the beginning of an entity. |
< | < | Treated as the beginning of a tag |
> | > | Treated as the ending of a tag |
" | " | Treated as the beginning and end of an attribute's value |
non-breaking space | | Space that will not break into a new line |
Example:
17. What is an HTML style element?
The HTML
Example:
The HTML
18. Explain HTML meter element?
The HTML
Some of the attributes of the HTML
- high
- low
- max
- min
- optimum
- value, etc.
Example:
19. What is an HTML del element?
The HTML
Example:
20. What HTML element defines the title of a work?
The HTML
Example:
21. What HTML element underlines the text?
The HTML
It is generally used to identify the misspelt terms.
Example:
22. What is an HTML details element?
The HTML
It has two states:
- open: We can see the additional information.
- close: We can't see the additional information. We can see only the summary.
Example:
The
23. How to create a range in HTML?
The HTML
It lets the user provide a number within the given range in the form of a slider.
Example:
- The HTML minattribute specifies the minimum value allowed
- The HTML maxattribute specifies the maximum value allowed
24. Why HTML 5 is best compared to old versions?
HTML 5 is the latest version of HTML.
Some of the new features added in HTML5 that make it better than HTML are:
- audioandvideoelements
- semantic elements like header,footer,figure,figcaption,nav, etc.
- placeholderattribute
- progresselement, etc.
25. What are the different doctypes in HTML?
Some of the doctype declarations for different versions of HTML are:
HTML5:
HTML4.01: (Strict doctype - Doesn't allow deprecated and presentation elements like
HTML4.01: (Transitional doctype - Allows deprecated and presentation elements like