Answer & Solution
<link> tag specifies the type of media content the CSS rules apply to, such as screen or print.
<link> tag when linking CSS stylesheets?
<link> tag specifies the type of media content the CSS rules apply to, such as screen or print.
What is the purpose of the rel attribute in the <link> tag when linking CSS stylesheets?
A). A. It specifies the relationship between the HTML file and the CSS file.
B). B. It defines the location of the CSS file.
C). C. It sets the rendering mode for the CSS file.
D). D. It determines the MIME type of the CSS file.
What is the primary disadvantage of using inline styles?
A). A. Increased file size of the HTML document.
B). B. Difficulty in maintaining consistency across multiple elements.
C). C. Limited scope for applying complex CSS rules.
D). D. Slower rendering of web pages.
When should inline styles be preferred over external stylesheets?
A). A. When applying styles globally to multiple HTML documents.
B). B. When reusing styles across multiple elements within a single HTML document.
C). C. When applying styles to only a specific element or small set of elements.
D). D. When creating a complex layout requiring extensive CSS rules.
Which CSS property is used to specify the font size of text?
A). A. text-size
B). B. font-size
C). C. size
D). D. font-style
What is the purpose of the type attribute in the <link> tag when linking CSS stylesheets?
A). A. It specifies the MIME type of the linked CSS file.
B). B. It defines the rendering mode for the CSS file.
C). C. It sets the relationship between the HTML file and the CSS file.
D). D. It determines the location of the CSS file.
How can you include comments in an external CSS file?
A). A. /* This is a comment */
B). B. // This is a comment
C). C. <!-- This is a comment -->
D). D. <!-- This is a comment -->
How do you link an external CSS file named 'styles.css' located in the same directory as your HTML file?
A). A. <link src='styles.css' rel='stylesheet'>
B). B. <link href='styles.css' type='text/css'>
C). C. <link rel='stylesheet' type='text/css' href='styles.css'>
D). D. <style src='styles.css'>
In HTML, which tag is used to define inline styles directly within the HTML document?
A). A. <style>
B). B. <link>
C). C. <script>
D). D. <css>
How do inline styles differ from external stylesheets linked using the <link> tag?
A). A. Inline styles are stored in a separate CSS file.
B). B. Inline styles override external stylesheets.
C). C. Inline styles are declared within the HTML document's <style> tag.
D). D. External stylesheets cannot be linked using the <link> tag.
Which of the following HTML tags can be styled using CSS?
A). A. <script>
B). B. <meta>
C). C. <header>
D). D. <body>