Site icon Computer science – Vibrant Online Academy

Menu and Division – Types of Style Sheets

  1. Which HTML tag is commonly used to create a navigation menu?
    a) <menu>
    b) <nav>
    c) <ul>
    d) <li>
    Answer: b) <nav>

  2. Which list type is typically used for navigation menus?
    a) <dl>
    b) <ol>
    c) <ul>
    d) <menu>
    Answer: c) <ul>

  3. Which HTML tag defines individual items in a list-based menu?
    a) <ul>
    b) <li>
    c) <item>
    d) <menuitem>
    Answer: b) <li>

  4. Which HTML element groups navigation links?
    a) <div>
    b) <header>
    c) <nav>
    d) <section>
    Answer: c) <nav>

  5. 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

  1. To create a vertical menu, list items are displayed:
    a) inline
    b) block
    c) float
    d) hidden
    Answer: b) block

  2. 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

  3. To add spacing between menu items, you can use:
    a) margin
    b) border
    c) display
    d) z-index
    Answer: a) margin

  4. 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>

  5. 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

  1. 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

  2. Which HTML tag is commonly used as a container for CSS styling?
    a) <span>
    b) <div>
    c) <style>
    d) <section>
    Answer: b) <div>

  3. What is the default display value of a <div>?
    a) inline
    b) none
    c) block
    d) flex
    Answer: c) block

  4. Which tag is an inline alternative to <div>?
    a) <nav>
    b) <span>
    c) <table>
    d) <section>
    Answer: b) <span>

  5. 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

  1. How many types of CSS style sheets are there?
    a) 2
    b) 4
    c) 3
    d) 5
    Answer: c) 3

  2. Which is NOT a type of style sheet in CSS?
    a) Inline
    b) External
    c) Internal
    d) Modular
    Answer: d) Modular

  3. Which style sheet type is written inside the HTML element?
    a) External
    b) Inline
    c) Internal
    d) Global
    Answer: b) Inline

  4. Which attribute is used for inline styles?
    a) class
    b) id
    c) style
    d) link
    Answer: c) style

  5. 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

  1. Which HTML tag is used to link external style sheets?
    a) <style>
    b) <script>
    c) <link>
    d) <css>
    Answer: c) <link>

  2. Which attribute in the <link> tag specifies the CSS file?
    a) type
    b) href
    c) src
    d) rel
    Answer: b) href

  3. What should be the value of the rel attribute in external CSS?
    a) style
    b) stylesheet
    c) css
    d) external
    Answer: b) stylesheet

  4. What is the correct file extension for external CSS files?
    a) .html
    b) .style
    c) .css
    d) .js
    Answer: c) .css

  5. 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

  1. Which style sheet has the highest priority?
    a) External
    b) Internal
    c) Inline
    d) None
    Answer: c) Inline

  2. Which style sheet is best for large websites with many pages?
    a) Inline
    b) External
    c) Internal
    d) Modular
    Answer: b) External

  3. Which is easiest for quick styling during debugging?
    a) External
    b) Inline
    c) Internal
    d) Linked
    Answer: b) Inline

  4. 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>

  5. What tag is used to write internal CSS?
    a) <link>
    b) <style>
    c) <css>
    d) <meta>
    Answer: b) <style>


🔹 Syntax and Application

  1. How do you apply a style to all <h1> elements?
    a) h1: {}
    b) h1 = {}
    c) h1 { }
    d) h1[]
    Answer: c) h1 { }

  2. Which symbol is used for class selector?
    a) #
    b) .
    c) @
    d) $
    Answer: b) .

  3. Which symbol is used for ID selector?
    a) .
    b) #
    c) !
    d) :
    Answer: b) #

  4. Which property changes the background color?
    a) color
    b) background
    c) bg-color
    d) background-color
    Answer: d) background-color

  5. What symbol opens and closes a CSS block?
    a) ( )
    b) [ ]
    c) { }
    d) < >
    Answer: c) { }


🔹 Good Practices

  1. 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>

  2. What’s the best type of stylesheet for code reusability?
    a) Inline
    b) Internal
    c) External
    d) Embedded
    Answer: c) External

  3. Which CSS type is least efficient for large projects?
    a) Internal
    b) Inline
    c) External
    d) Linked
    Answer: b) Inline

  4. 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

  5. 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

  1. What is the correct syntax for an ID selector named “menu”?
    a) menu { }
    b) #menu { }
    c) .menu { }
    d) menu[]
    Answer: b) #menu { }

  2. Which is the correct class selector syntax for “active”?
    a) #active { }
    b) active: {}
    c) .active { }
    d) active()
    Answer: c) .active { }

  3. Which of these is a block-level element?
    a) <div>
    b) <span>
    c) <a>
    d) <img>
    Answer: a) <div>

  4. Which of the following is used to group inline elements?
    a) <div>
    b) <span>
    c) <li>
    d) <ul>
    Answer: b) <span>

  5. Which tag is not semantic?
    a) <nav>
    b) <article>
    c) <div>
    d) <header>
    Answer: c) <div>


🔹 Final Questions

  1. Inline CSS is written using the:
    a) style attribute
    b) link tag
    c) script tag
    d) id attribute
    Answer: a) style attribute

  2. Which stylesheet type is best for responsive websites?
    a) Inline
    b) Internal
    c) External
    d) All
    Answer: c) External

  3. What should be the file format of external CSS?
    a) .html
    b) .xml
    c) .css
    d) .js
    Answer: c) .css

  4. To use same style in multiple pages, we use:
    a) Inline CSS
    b) Internal CSS
    c) External CSS
    d) JavaScript
    Answer: c) External CSS

  5. Which is the most organized way to manage CSS in large websites?
    a) Inline
    b) External
    c) Internal
    d) Embedded
    Answer: b) External

Exit mobile version