Assuming the file "main.css" exists in the same folder.
medium
A. The <link> tag is correctly placed and written.
B. The <link> tag should be inside the <body> tag.
C. The href attribute value is incorrect.
D. The <link> tag is missing the 'rel' attribute.
Solution
Step 1: Check the <link> tag attributes
The <link> tag has rel="stylesheet" and href="main.css", which is correct.
Step 2: Verify placement of the <link> tag
The <link> tag is correctly placed inside the <head> section, which is standard practice.
Final Answer:
The <link> tag is correctly placed and written. -> Option A
Quick Check:
Correct <link> tag with rel and href in <head> [OK]
Hint: Place <link> in <head> with rel and correct href [OK]
Common Mistakes:
Putting <link> inside <body> instead of <head>
Forgetting rel="stylesheet" attribute
Incorrect file path in href
5. You want to link two CSS files, "base.css" and "theme.css", to your HTML page. "theme.css" should override some styles in "base.css". Which is the correct way to link them?
hard
A.
B.
C.
D.
Solution
Step 1: Understand CSS loading order
CSS files loaded later override earlier ones if selectors match.
Step 2: Place base.css first, then theme.css
Link base.css first, then theme.css so theme.css can override base styles.
Step 3: Check options for correct syntax and order
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="theme.css"> links base.css first, then theme.css correctly. <link rel="stylesheet" href="theme.css">
<link rel="stylesheet" href="base.css"> reverses order. <style>@import url('theme.css'); @import url('base.css');</style> uses @import inside <style> tag but loads theme.css first then base.css, so base overrides theme incorrectly. <link rel="stylesheet" href="base.css" theme="theme.css"> is invalid syntax.
Final Answer:
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="theme.css"> -> Option D
Quick Check:
Load base.css before theme.css for overrides [OK]
Hint: Link base.css first, then theme.css to override [OK]