HTML 5 Test 1 — Questions and Answers
Question 1: _________ is the ancestor of all other components on the page.
- root element (Correct answer)
- ancestor
- siblings
- parent
Correct answer: root element
Explanation: <br> The root element is the ancestor of all the other elements on the page.
Question 2: What is the CSS position property's default value?
- absolute
- fixed
- relative
- static (Correct answer)
Correct answer: static
Explanation: <br> If no explicit position is supplied for any html element, the default position is static. No matter whatever tag, the default value for the CSS property position is static.
Question 3: What is the name of the canvas API?
- immediate-mode (Correct answer)
- retained-mode
- vector-based
- xml-based
Correct answer: immediate-mode
Explanation: <br> When you use the canvas element in HTML, instant mode is activated. Anything you want to draw inside it needs you to use primitive draw commands and manage the scene, including redrawing when things change.
Question 4: To draw a circle on a canvas, which JavaScript method is used?
- arc (Correct answer)
- bezierCurveTo
- ellipse
- circle
Correct answer: arc
Explanation: <br> The arc method in JavaScript can be used to draw a circle in an HTML5 canvas. We can add the canvas element, for example, by writing: <br> <br> <canvas style='width: 300px; height: 300px'></canvas>
Question 5: Which of the following statements regarding HTML5's Web form 2.0 is correct?
- HTML5 form elements and attributes give a higher level of semantic mark-up than HTML4 form elements and attributes.
- Web Forms 2.0 is an enhancement to HTML4's form functionalities.
- HTML5's form components and attributes eliminate a lot of the time-consuming coding and styling that HTML4 required.
- All of the above (Correct answer)
Correct answer: All of the above
The correct answer: <br> All of the above
Question 6: Which of the following elements is used to highlight content in the same way as a highlighter pen is used to highlight key text in a book?
- strong
- mark (Correct answer)
- em
- none of the above
Correct answer: mark
Explanation: <br> In HTML 5, the mark> tag was introduced. The mark> tag in HTML is used to indicate that text has been marked or highlighted for reference purposes because it is relevant in another context. All major browsers recognize the mark> tag. If you wish to highlight parts of your text, use the mark> tag. We can mark the text with a variety of html5 global characteristics, such as changing the font, background color, font color, and so on. The opening and closing mark> tags are required for this tag.
Question 7: In HTML5, what do you use instead of cookies?
- Local Storage (Correct answer)
- Web beacons
- Java scripts
- None of the above
Correct answer: Local Storage
Explanation: <br> Many usage of cookies were superseded by the use of LocalStorage after HTML5 was released. This is due to the several advantages that LocalStorage provides over cookies. One of the most significant distinctions is that, unlike cookies, data is not need to be transferred back and forth with each HTTP request.
Question 8: HTML5 is supported by which of the following browsers?
- Internet Explorer
- Safari
- Firefox
- All the above (Correct answer)
Correct answer: All the above
Explanation: <br> Versions of Internet Explorer, Chrome, Firefox, Safari, Opera, Android Browser, and iOS Safari all support some parts of HTML5. HTML5 features such as the hidden attribute, autofocus attribute, SVG favicons, PNG favicons, and Web cryptography are supported by different browsers. HTML5Test.com provides an overall score out of 555 points to indicate how well a modern Web browser supports HTML5.
Question 9: In HTML5, which of the following tags is used to represent the output of various forms of output?
- required
- output (Correct answer)
- placeholder
- autofocus
Correct answer: output
Explanation: <br> In HTML, the <output> tag is used to express the result of a computation done by a client-side script like JavaScript. In HTML 5, the <output> tag is a new tag that requires a starting and ending tag.
_________ is the ancestor of all other components on the page.