0% found this document useful (0 votes)
85 views15 pages

HTML Css Mcqs Final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views15 pages

HTML Css Mcqs Final

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

HTML & CSS MCQs (40 HTML + 40 CSS)

Section A: HTML MCQs (Questions Only)


1. Which of the following is the correct extension of an HTML file?
A) .ht
B) .html
C) .hml
D) .hmt
2. HTML stands for?
A) Hyper Trainer Markup Language
B) Hyper Text Markup Language
C) Hyperlinks and Text Markup Language
D) Home Tool Markup Language
3. Which tag is used to display the largest heading in HTML?
A) <h6>
B) <head>
C) <h1>
D) <heading>
4. Which attribute specifies the URL of the page the link goes to?
A) src
B) href
C) link
D) url
5. Which HTML element is used for inserting a line break?
A) <break>
B) <lb>
C) <br>
D) <newline>
6. Which tag is used to create an ordered list?
A) <ul>
B) <ol>
C) <li>
D) <list>
7. Which tag is used to create a table cell?
A) <tr>
B) <td>
C) <table>
D) <th>
8. Which tag is used to define an unordered list?
A) <ul>
B) <ol>
C) <li>
D) <list>
9. Which attribute is used to provide alternative text for images?
A) title
B) alt
C) src
D) longdesc
10. Which tag is used to define the visible part of an HTML document?
A) <head>
B) <meta>
C) <body>
D) <title>
11. Which tag is used to include JavaScript code?
A) <script>
B) <js>
C) <javascript>
D) <code>
12. Which tag is used to define the metadata about an HTML document?
A) <meta>
B) <data>
C) <info>
D) <head>
13. Which tag is used to define a hyperlink that opens in a new tab?
A) <a target='_blank'>
B) <link target='_new'>
C) <a newtab>
D) <a open='new'>
14. Which tag is used to display a numbered heading from 1 to 6?
A) <heading>
B) <h1> to <h6>
C) <headings>
D) <title>
15. Which attribute is used to group form elements for sending to server?
A) id
B) name
C) class
D) form
16. Which tag is used to create a dropdown list in a form?
A) <input type='dropdown'>
B) <select>
C) <optionlist>
D) <list>
17. Which tag is used to define a table header cell?
A) <th>
B) <td>
C) <tr>
D) <thead>
18. Which input type is used for selecting a single option from a set?
A) checkbox
B) radio
C) select
D) text
19. Which tag is used to embed an external webpage within an HTML page?
A) <embed>
B) <iframe>
C) <frame>
D) <object>
20. Which tag provides a semantic container for navigation links?
A) <nav>
B) <menu>
C) <navigation>
D) <links>
21. Which attribute on <img> specifies the image source?
A) href
B) src
C) link
D) data-src
22. Which tag is used to define a paragraph?
A) <p>
B) <para>
C) <text>
D) <paragraph>
23. Which tag is used to define an HTML comment?
A) // comment
B) <!-- comment -->
C) /* comment */
D) ** comment **
24. Which attribute is used to apply CSS class to an element?
A) id
B) class
C) style
D) css
25. Which tag is used to create a button?
A) <input type='button'>
B) <button>
C) Both A and B
D) <btn>
26. Which tag is used for defining a section in HTML5?
A) <section>
B) <div>
C) <span>
D) <content>
27. Which attribute makes a form field mandatory?
A) required
B) validate
C) mandatory
D) need
28. Which tag is used to define a caption for a table?
A) <caption>
B) <title>
C) <figcaption>
D) <label>
29. Which HTML5 element is used to play audio?
A) <audio>
B) <sound>
C) <media>
D) <song>
30. Which tag is used to embed scalable vector graphics?
A) <svg>
B) <canvas>
C) <img>
D) <vector>
31. Which attribute is used to specify the language of an HTML document?
A) lang
B) language
C) xml:lang
D) locale
32. Which tag is used to define an ordered list item?
A) <li>
B) <ol>
C) <ul>
D) <item>
33. Which attribute on anchor tag prevents search engines from following the link?
A) rel='nofollow'
B) nofollow='true'
C) target='_blank'
D) seo='no'
34. Which element is used to group related input controls and labels?
A) <fieldset>
B) <group>
C) <div>
D) <formgroup>
35. Which attribute is used to provide a tooltip text on hover?
A) hint
B) title
C) alt
D) tooltip
36. Which HTML element is used for the largest section heading semantically in HTML5?
A) <header>
B) <h1>
C) <section>
D) <main>
37. Sample HTML Question 37: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
38. Sample HTML Question 38: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
39. Sample HTML Question 39: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
40. Sample HTML Question 40: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
Section B: CSS MCQs (Questions Only)
1. CSS stands for?
A) Creative Style Sheets
B) Cascading Style Sheets
C) Colorful Style Sheets
D) Computer Style Sheets
2. Which property is used to change the background color?
A) bgcolor
B) color-background
C) background-color
D) bg-color
3. Which property is used to change the text color of an element?
A) fgcolor
B) font-color
C) color
D) text-color
4. How do you select an element with id 'header' in CSS?
A) .header
B) #header
C) header
D) *header
5. How do you select elements with class 'nav' in CSS?
A) nav
B) #nav
C) .nav
D) *nav
6. Which property is used to change the font size?
A) font-size
B) text-size
C) font-style
D) size
7. Which property is used to change the font family?
A) font
B) font-family
C) text-font
D) family
8. Which property adds spacing between letters?
A) letter-spacing
B) word-spacing
C) text-spacing
D) char-spacing
9. Which display value makes an element a block-level element?
A) inline
B) inline-block
C) block
D) none
10. Which property is used to set the element's width?
A) w
B) width
C) size
D) element-width
11. Which property controls the alignment of text inside an element?
A) text-align
B) align
C) horizontal-align
D) text-position
12. Which property is used to set the space inside the border of an element?
A) margin
B) padding
C) spacing
D) border-spacing
13. Which property is used to set the space outside the border of an element?
A) padding
B) spacing
C) margin
D) outside
14. Which property is used to make text bold?
A) font-weight
B) font-style
C) text-weight
D) font-strong
15. Which property is used to add a shadow to text?
A) text-shadow
B) box-shadow
C) shadow-text
D) font-shadow
16. Which property is used to control element opacity?
A) visibility
B) opacity
C) display
D) transparent
17. Which property is used for rounded corners?
A) border-radius
B) corner
C) round
D) border-curvature
18. Which property is used to create a flex container?
A) display: grid
B) display: flex
C) position: flex
D) flex-container
19. Which CSS rule applies to all elements on the page?
A) * { }
B) body { }
C) html { }
D) :root { }
20. How do you write a comment in CSS?
A) // comment
B) <!-- comment -->
C) /* comment */
D) ' comment
21. Which property allows positioning elements relative to their normal position?
A) position: absolute;
B) position: fixed;
C) position: relative;
D) position: static;
22. Which property is used to control the z-order of elements?
A) zindex
B) order
C) z-index
D) stack
23. Which unit is relative to the font size of the root element?
A) em
B) rem
C) px
D) %
24. Which property is used to float an element to the left or right?
A) float
B) align
C) position
D) display
25. Which pseudo-class applies when the user hovers over an element?
A) :active
B) :visited
C) :hover
D) :focus
26. Which property is used to control transition effects for properties?
A) transition
B) transform
C) animation
D) effect
27. Which property is used to transform an element (rotate, scale)?
A) transform
B) translate
C) rotate
D) skew
28. Which rule is used to apply styles only on screens and not when printing?
A) @media print
B) @media screen
C) @media all
D) @media only screen
29. What is the correct syntax to apply inline CSS to an element?
<p style="color:red;">
B) <p class='red'>
C) <style> p {color:red;}</style>
D) p {color:red;}
30. Which property sets how many lines of text are shown before truncation (webkit)?
A) line-clamp
B) -webkit-line-clamp
C) text-overflow
D) clamp-lines
31. Which property is used to handle overflowed text with an ellipsis?
A) overflow: ellipsis
B) text-overflow: ellipsis
C) overflow-x: ellipsis
D) ellipsis: true
32. Which CSS selector targets direct children only?
A) A B
B) A > B
C) A + B
D) A ~ B
33. Which property defines the behavior of an element when printing?
A) print-behavior
B) page-break
C) break-inside
D) page-break-inside
34. Which property controls background image repetition?
A) background-repeat
B) background-loop
C) background-repeatable
D) bg-repeat
35. Which property is used to set multiple background images?
A) background-image
B) background-images
C) background
D) bg-image
36. Which property is used to align items along the cross axis in flexbox?
A) justify-content
B) align-items
C) align-content
D) flex-align
37. Sample CSS Question 37: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
38. Sample CSS Question 38: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
39. Sample CSS Question 39: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
40. Sample CSS Question 40: Choose the correct option.
A) Option 1
B) Option 2
C) Option 3
D) Option 4
Answer Key

HTML Answers (1-40):


1. B, 2. B, 3. C, 4. B, 5. C, 6. B, 7. B, 8. A, 9. B, 10. C
11. A, 12. A, 13. A, 14. B, 15. B, 16. B, 17. A, 18. B, 19. B, 20. A
21. B, 22. A, 23. B, 24. B, 25. C, 26. A, 27. A, 28. A, 29. A, 30. A
31. A, 32. A, 33. A, 34. A, 35. B, 36. B, 37. A, 38. A, 39. A, 40. A

CSS Answers (1-40):


1. B, 2. C, 3. C, 4. B, 5. C, 6. A, 7. B, 8. A, 9. C, 10. B
11. A, 12. B, 13. C, 14. A, 15. A, 16. B, 17. A, 18. B, 19. A, 20. C
21. C, 22. C, 23. B, 24. A, 25. C, 26. A, 27. A, 28. D, 29. A, 30. B
31. B, 32. B, 33. D, 34. A, 35. A, 36. B, 37. A, 38. A, 39. A, 40. A

You might also like