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.
Which of the following HTML tags can be styled using CSS?
A). A. <script>
B). B. <meta>
C). C. <header>
D). D. <body>
Which attribute is used in the <link> tag to specify the location of the external CSS file?
A). A. src
B). B. rel
C). C. href
D). D. type
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'>
Which of the following statements is true regarding the order of precedence in CSS styling?
A). A. Inline styles have the lowest precedence and are overridden by external stylesheets.
B). B. External stylesheets have the highest precedence and override inline styles.
C). C. Styles declared later in the HTML document take precedence over styles declared earlier.
D). D. Styles with more specific selectors override styles with less specific selectors.
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 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
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>
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.
What is the primary purpose of using the <link> tag to link CSS stylesheets in HTML?
A). A. To apply CSS styles inline
B). B. To define CSS styles within the HTML file
C). C. To link an external CSS file to the HTML document
D). D. To embed CSS styles directly into the HTML document
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 -->