-
Which HTML tag is commonly used to create a navigation menu?
a)<menu>
b)<nav>
c)<ul>
d)<li>
Answer: b)<nav>
-
Which list type is typically used for navigation menus?
a)<dl>
b)<ol>
c)<ul>
d)<menu>
Answer: c)<ul>
-
Which HTML tag defines individual items in a list-based menu?
a)<ul>
b)<li>
c)<item>
d)<menuitem>
Answer: b)<li>
-
Which HTML element groups navigation links?
a)<div>
b)<header>
c)<nav>
d)<section>
Answer: c)<nav>
-
What CSS property is commonly used to create horizontal menus?
a) display: block
b) float: left
c) text-align: center
d) display: inline-block
Answer: d) display: inline-block
🔹 Vertical & Horizontal Menus
-
To create a vertical menu, list items are displayed:
a) inline
b) block
c) float
d) hidden
Answer: b) block -
Which CSS property removes bullet points in a menu?
a) text-style: none
b) bullet: none
c) list-style: none
d) decoration: none
Answer: c) list-style: none -
To add spacing between menu items, you can use:
a) margin
b) border
c) display
d) z-index
Answer: a) margin -
What tag combination is commonly used for dropdown menus?
a)<div>
+<button>
b)<ul>
+<li>
c)<nav>
+<select>
d)<table>
+<tr>
Answer: b)<ul>
+<li>
-
Which property makes menu items align in one line?
a) display: block
b) float: none
c) display: inline
d) overflow: auto
Answer: c) display: inline
🔹 Divisions in HTML
-
What is the purpose of the
<div>
tag in HTML?
a) To create links
b) To divide sections of a web page
c) To insert headings
d) To style paragraphs
Answer: b) To divide sections of a web page -
Which HTML tag is commonly used as a container for CSS styling?
a)<span>
b)<div>
c)<style>
d)<section>
Answer: b)<div>
-
What is the default display value of a
<div>
?
a) inline
b) none
c) block
d) flex
Answer: c) block -
Which tag is an inline alternative to
<div>
?
a)<nav>
b)<span>
c)<table>
d)<section>
Answer: b)<span>
-
Which tag is best for semantic layout instead of
<div>
?
a)<head>
b)<link>
c)<article>
d)<body>
Answer: c)<article>
🔹 Types of Style Sheets
-
How many types of CSS style sheets are there?
a) 2
b) 4
c) 3
d) 5
Answer: c) 3 -
Which is NOT a type of style sheet in CSS?
a) Inline
b) External
c) Internal
d) Modular
Answer: d) Modular -
Which style sheet type is written inside the HTML element?
a) External
b) Inline
c) Internal
d) Global
Answer: b) Inline -
Which attribute is used for inline styles?
a) class
b) id
c) style
d) link
Answer: c) style -
Where is an internal style sheet defined?
a) Inside<body>
b) Inside<style>
tag in<head>
c) After closing</html>
d) Inside a<div>
Answer: b) Inside<style>
tag in<head>
🔹 External Style Sheets
-
Which HTML tag is used to link external style sheets?
a)<style>
b)<script>
c)<link>
d)<css>
Answer: c)<link>
-
Which attribute in the
<link>
tag specifies the CSS file?
a) type
b) href
c) src
d) rel
Answer: b) href -
What should be the value of the
rel
attribute in external CSS?
a) style
b) stylesheet
c) css
d) external
Answer: b) stylesheet -
What is the correct file extension for external CSS files?
a) .html
b) .style
c) .css
d) .js
Answer: c) .css -
What is the advantage of using external CSS?
a) Applies to one page only
b) Reduces page load time
c) Applies to multiple pages
d) Cannot be reused
Answer: c) Applies to multiple pages
🔹 Inline vs Internal vs External
-
Which style sheet has the highest priority?
a) External
b) Internal
c) Inline
d) None
Answer: c) Inline -
Which style sheet is best for large websites with many pages?
a) Inline
b) External
c) Internal
d) Modular
Answer: b) External -
Which is easiest for quick styling during debugging?
a) External
b) Inline
c) Internal
d) Linked
Answer: b) Inline -
Where is the internal CSS written in an HTML file?
a) Inside<body>
b) Inside<link>
c) Inside<style>
d) Inside<script>
Answer: c) Inside<style>
-
What tag is used to write internal CSS?
a)<link>
b)<style>
c)<css>
d)<meta>
Answer: b)<style>
🔹 Syntax and Application
-
How do you apply a style to all
<h1>
elements?
a) h1: {}
b) h1 = {}
c) h1 { }
d) h1[]
Answer: c) h1 { } -
Which symbol is used for class selector?
a) #
b) .
c) @
d) $
Answer: b) . -
Which symbol is used for ID selector?
a) .
b) #
c) !
d) :
Answer: b) # -
Which property changes the background color?
a) color
b) background
c) bg-color
d) background-color
Answer: d) background-color -
What symbol opens and closes a CSS block?
a) ( )
b) [ ]
c) { }
d) < >
Answer: c) { }
🔹 Good Practices
-
Where should the external CSS link be placed in HTML?
a) Anywhere
b) Bottom of<body>
c) Inside<head>
d) After</html>
Answer: c) Inside<head>
-
What’s the best type of stylesheet for code reusability?
a) Inline
b) Internal
c) External
d) Embedded
Answer: c) External -
Which CSS type is least efficient for large projects?
a) Internal
b) Inline
c) External
d) Linked
Answer: b) Inline -
How many external stylesheets can you link in one HTML file?
a) 1
b) 2
c) Only one per file
d) As many as needed
Answer: d) As many as needed -
Which of the following is valid inline CSS?
a) style=”color: red;”
b) css=”red”
c) link=”style.css”
d) href=”color:red”
Answer: a) style=”color: red;”
🔹 Miscellaneous
-
What is the correct syntax for an ID selector named “menu”?
a) menu { }
b) #menu { }
c) .menu { }
d) menu[]
Answer: b) #menu { } -
Which is the correct class selector syntax for “active”?
a) #active { }
b) active: {}
c) .active { }
d) active()
Answer: c) .active { } -
Which of these is a block-level element?
a)<div>
b)<span>
c)<a>
d)<img>
Answer: a)<div>
-
Which of the following is used to group inline elements?
a)<div>
b)<span>
c)<li>
d)<ul>
Answer: b)<span>
-
Which tag is not semantic?
a)<nav>
b)<article>
c)<div>
d)<header>
Answer: c)<div>
🔹 Final Questions
-
Inline CSS is written using the:
a) style attribute
b) link tag
c) script tag
d) id attribute
Answer: a) style attribute -
Which stylesheet type is best for responsive websites?
a) Inline
b) Internal
c) External
d) All
Answer: c) External -
What should be the file format of external CSS?
a) .html
b) .xml
c) .css
d) .js
Answer: c) .css -
To use same style in multiple pages, we use:
a) Inline CSS
b) Internal CSS
c) External CSS
d) JavaScript
Answer: c) External CSS -
Which is the most organized way to manage CSS in large websites?
a) Inline
b) External
c) Internal
d) Embedded
Answer: b) External