QUESTION IMAGE
Question
what is the correct syntax to add an external style sheet to a web page?
options:
<link type=\text/css\ rel=\styles.css\ />
<style type=\text/css\ href=\styles.css\ />
<link href=\stylesheet\ type=\text/css\ rel=\styles.css\ />
<link rel=\stylesheet\ type=\text/css\ href=\styles.css\ />
To add an external style sheet, the <link> tag is used. The correct attributes are rel="stylesheet" (to define the relationship as a stylesheet), type="text/css" (to specify the MIME type), and href with the path to the CSS file. Let's analyze each option:
- First option:
relshould be "stylesheet", not the CSS file name, so incorrect. - Second option:
<style>tag is for internal or embedded styles, not external, so incorrect. - Third option:
hrefshould point to the CSS file, not "stylesheet", andrelshould be "stylesheet", so incorrect. - Fourth option: Has
rel="stylesheet",type="text/css", andhrefpointing to the CSS file, which is correct.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
D. <link rel="stylesheet" type="text/css" href="styles.css" />