Which HTML element is used to define the title of a document?
<title>
<header>
<head>
<meta>
Pertanyaan 2
Pilihan ganda
True or False: The <footer> element is used to define the header of a webpage.
True
False
Pertanyaan 3
Pilihan ganda
Analyze the following HTML snippet: <p id='intro'>Hello, World!</p>. What is the purpose of the 'id' attribute?
To style the paragraph
To uniquely identify the element
To link to an external resource
To define the element's class
Pertanyaan 4
Pilihan ganda
What is the primary purpose of the <body> tag in an HTML document?
To define the document's metadata
To link to CSS files
To contain the document's visible content
To import scripts
Pertanyaan 5
Pilihan ganda
True or False: The <img> tag requires a closing tag.
True
False
Pertanyaan 6
Pilihan ganda
In the following story, identify the HTML tag used: 'Once upon a time, there was a webpage with a list of items neatly organized.' Which tag is commonly used for lists?
<div>
<ul>
<span>
<p>
Pertanyaan 7
Pilihan ganda
Which of the following elements is used to create a hyperlink in HTML?
<link>
<a>
<href>
<nav>
Pertanyaan 8
Pilihan ganda
True or False: The <strong> tag is used to italicize text.
True
False
Pertanyaan 9
Pilihan ganda
Analyze the following HTML snippet: <div class='container'>Content here</div>. What does the 'class' attribute do?
Defines the element's ID
Applies styles to the element
Links to an external stylesheet
Creates an internal script
Pertanyaan 10
Pilihan ganda
In a story about a webpage, the main character decides to add a background color. Which CSS property should they use?
color
background-color
border
font-family
Pertanyaan 11
Pilihan ganda
Is this a complete HTML document?
html
<!DOCTYPE html>
<html>
<head>
<title>Sample Page</title>
</head>
<body>
<h1>Hello, World!</h1>
Yes, it's complete.
No, it is missing the closing </body> and </html> tags.
No, it is missing a DOCTYPE declaration.
No, it is missing a <head> section.
Pertanyaan 12
Pilihan ganda
What is missing in this HTML snippet to make it a valid HTML5 document?
html
<html>
<head>
<title>My Page</title>
</head>
<body>
<p>Welcome to my page!</p>
</body>
</html>
A <meta> tag in the <head> section.
A DOCTYPE declaration.
The <html> tag should have a lang attribute.
An external CSS link.
Pertanyaan 13
Pilihan ganda
What is incorrect in the following HTML code?
html
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h2>About Me</h1>
</body>
</html>
The <h2> tag is not closed properly.
The <title> tag should be outside of the <head>.
The <body> tag is missing a closing tag.
The <html> tag is missing a lang attribute.
Pertanyaan 14
Pilihan ganda
Identify the error in the following HTML code:
html
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
</head>
<body>
<p>This is a paragraph.
<p>This is another paragraph.</p>
</body>
</html>
The <p> tag is not closed in the first paragraph.
The <title> tag is in the wrong position.
The <head> section is incomplete.
The DOCTYPE declaration is incorrect.
Pertanyaan 15
Pilihan ganda
Which attribute is needed to make an HTML5 form element accessible?
html
<form>
<input type="text" name="username">
</form>
id
class
label
aria-label
Pertanyaan 16
Pilihan ganda
What is the purpose of the <meta charset="UTF-8"> tag in the HTML <head> section?
To specify the character encoding for the HTML document.
To define the viewport settings for mobile devices.
To link external stylesheets.
To specify the language of the document.
Pertanyaan 17
Pilihan ganda
In the context of HTML forms, what does the 'action' attribute define?
The method of form submission.
The URL to send form data to.
The type of data input.
The CSS style applied to the form.
Pertanyaan 18
Pilihan ganda
What is the correct way to embed a video in HTML5?
<video src="movie.mp4" controls></video>
<embed src="movie.mp4" controls>
<media src="movie.mp4" controls>
<video href="movie.mp4" controls></video>
Pertanyaan 19
Pilihan ganda
How can you make the text 'Hello World' bold using HTML?
<bold>Hello World</bold>
<strong>Hello World</strong>
<bld>Hello World</bld>
<b>Hello World</b>
Pertanyaan 20
Pilihan ganda
What is the main difference between <section> and <div> elements in HTML5?
<section> is used for semantic content, while <div> is for styling.