Consider the structure of an HTML page. What is the main purpose of the <head> element?
<!DOCTYPE html> <html> <head> <title>Example</title> </head> <body> <p>Hello World!</p> </body> </html>
Think about what information is needed by the browser but not shown directly on the page.
The <head> element holds metadata such as the page title, character set, links to CSS files, and scripts that affect the page but are not displayed as content.
Look at this HTML code. What text will appear on the web page when rendered?
<!DOCTYPE html>
<html>
<body>
<h1>Welcome</h1>
<p>This is a <strong>simple</strong> page.</p>
<footer>Contact us</footer>
</body>
</html>Remember that HTML ignores line breaks in code and spaces separate text.
The browser displays the text content with spaces between elements. Tags like <br> are needed for line breaks, which are not present here.
Identify the HTML tag that creates a hyperlink to another web page.
Think about the tag that wraps text to make it clickable.
The <a> tag defines a hyperlink. The href attribute inside it specifies the link destination.
Choose the correct HTML code to include an external CSS stylesheet named styles.css.
Remember the tag used for linking stylesheets and the attribute names.
The <link> tag with rel="stylesheet" and href attributes correctly links an external CSS file.
Given the following HTML and CSS, what color will the paragraph text appear as?
<!DOCTYPE html> <html lang="en"> <head> <style> p { color: blue; } .highlight { color: red !important; } </style> </head> <body> <p class="highlight" style="color: green;">Text color test</p> </body> </html>
Consider CSS specificity and the effect of !important.
The !important rule overrides inline styles, so the paragraph text will be red.