Advertisements
Advertisements
Question
How do you link an external stylesheet to a page.
Options
<link href=’somefile.css’><link rel=’stylesheet’ src=’somefile.css’><script rel=’stylesheet’ href=’somefile.css’> </script><link rel=’stylesheet’ href=’somefile.css’>
MCQ
Advertisements
Solution
<link rel=’stylesheet’ href=’somefile.css’>
Explanation:
The explanation of the correct syntax is as follows:
- <link>: This HTML tag connects external files, like stylesheets, to the webpage.
- rel='stylesheet': This attribute defines the link’s relationship, stating that the connected file is a style document.
- href='somefile.css': This attribute specifies the path or URL destination of the target CSS file (here, "somefile.css").
Ultimately, utilising this tag with these specific attributes binds the external CSS file to the HTML document, applying those styles across the web page.
shaalaa.com
Is there an error in this question or solution?
