Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
478 views

HTML and CSS Sample Question

The document contains questions about HTML and CSS topics. It has 50 multiple choice questions covering HTML tags, attributes, and elements as well as CSS properties, values, and selectors. The questions test knowledge of topics like hyperlinks, images, lists, headings, tables, and forms in HTML and colors, typography, layout, positioning in CSS.

Uploaded by

radinlandrio0102
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
478 views

HTML and CSS Sample Question

The document contains questions about HTML and CSS topics. It has 50 multiple choice questions covering HTML tags, attributes, and elements as well as CSS properties, values, and selectors. The questions test knowledge of topics like hyperlinks, images, lists, headings, tables, and forms in HTML and colors, typography, layout, positioning in CSS.

Uploaded by

radinlandrio0102
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

HTML and CSS

Part I: HTML
1. What does HTML stand for?
a) Hyperlink Text Markup Language
b) Hyperlink and Text Markup Language
c) Hypertext Markup Language
d) Hypertext and Text Markup Language

2. Which tag is used to create a hyperlink in HTML?


a) <link>
b) <href>
c) <a>
d) <hyperlink>

3. What is the correct HTML tag for inserting a line break?


a) <br>
b) <lb>
c) <break>
d) <line>

4. What is the correct HTML tag for creating a numbered list?


a) <ul>
b) <list>
c) <ol>
d) <numlist>

5. Which tag is used to define an image in HTML?


a) <img>
b) <image>
c) <picture>
d) <src>

6. What does the HTML <div> element represent?


a) A division or a section of the document
b) A hyperlink
c) An image
d) A line break
7. Which HTML element is used for the largest heading?
a) <h1>
b) <heading>
c) <head>
d) <header>

8. Which tag is used for creating a table in HTML?


a) <table>
b) <tab>
c) <tbl>
d) <grid>

9. Which attribute is used to specify an alternate text for an image, if the image cannot be displayed?
a) alt
b) src
c) title
d) caption
10. Which HTML tag is used to define an unordered list?
a) <ul>
b) <ol>
c) <li>
d) <list>

11. What does HTML5 introduce to replace the <div> element in some cases?
a) <section>
b) <divv>
c) <division>
d) <group>

12. Which attribute is used to provide additional information about an element in HTML?
a) info
b) data
c) class
d) extra

13. What is the correct way to create an email link in HTML?


a) <a href="mailto:info@example.com">Contact us</a>
b) <a href="info@example.com">Contact us</a>
c) <mail>info@example.com</mail>
d) <email>info@example.com</email>
14. What is the HTML tag used to define a paragraph?
a) <para>
b) <p>
c) <paragraph>
d) <text>

15. Which HTML tag is used for defining the footer?


a) <foot>
b) <footer>
c) <end>
d) <bottom>

Part II: CSS


16. What does CSS stand for?
a) Cascading Style Sheets
b) Creative Style Sheets
c) Computer Style Sheets
d) Colorful Style Sheets

17. Which CSS property is used to change the text color of an element?
a) text-color
b) color
c) font-color
d) text-style

18. How can you include a comment in a CSS file?


a) // This is a comment
b) <!-- This is a comment -->
c) /* This is a comment */
d) // This is a comment //

19. Which property is used to control the spacing between lines of text?
a) line-height
b) text-spacing
c) font-spacing
d) letter-spacing
20. Which CSS property is used to control the size of text?
a) font-size
b) text-size
c) size
d) text-font
21. What is the default value of the position property in CSS?
a) absolute
b) fixed
c) relative
d) static

22. What does the CSS property "float" do?


a) It makes the element float to the right or left
b) It changes the element's color
c) It animates the element
d) It enlarges the element

23. Which CSS property is used to add shadows to elements?


a) shadow
b) text-shadow
c) box-shadow
d) element-shadow

24. How do you group multiple selectors to apply the same styles to them in CSS?
a) Separate them with commas
b) Separate them with spaces
c) Separate them with colons
d) Separate them with semicolons

25. Which property is used to change the background color of an element?


a) color
b) background-color
c) bg-color
d) bgcolor

26. What does the CSS property "display: none;" do?


a) It hides the element
b) It makes the element visible
c) It changes the font of the element
d) It enlarges the element
27. Which CSS property is used to set the style of the top border of an element?
a) border-top-style
b) border-style-top
c) top-border-style
d) style-top-border

28. Which CSS property is used to control the space between individual letters in text?
a) word-spacing
b) letter-spacing
c) text-spacing
d) font-spacing

29. What is the purpose of the CSS property "position: relative;"?


a) It positions the element relative to its normal position
b) It makes the element's position fixed
c) It aligns the element to the right
d) It centers the element horizontally

30. Which CSS property is used to change the font of an element?


a) text-font
b) font-family
c) font-style
d) typeface

31. How do you specify a class in CSS?


a) .classname
b) #classname
c) classname:
d) class=classname

32. What does the CSS property "padding" define?


a) Space between the border and the content inside an element
b) Space outside the border of an element
c) Space between lines of text
d) Space between words
33. Which property is used to change the alignment of text in an element?
a) text-align
b) align-text
c) text-justify
d) align

34. How do you apply multiple CSS styles to an element?


a) Using inline styles
b) Using external stylesheets
c) Using internal stylesheets
d) Using the style attribute

35. Which CSS property is used to add a background image to an element?


a) bg-image
b) background-image
c) image-background
d) bg-picture

HTML
36. What is the purpose of the HTML <meta> tag?
a) To create a clickable link
b) To define metadata about an HTML document
c) To embed videos
d) To display an image

37. Which HTML tag is used for defining an input field for entering numeric values?
a) <input type="number">
b) <input type="text">
c) <input type="numeric">
d) <input type="integer">

38. How can you create a hyperlink that opens in a new tab in HTML?
a) <a href="url" target="_self">Link</a>
b) <a href="url" target="_blank">Link</a>
c) <a href="url" target="_new">Link</a>
d) <a href="url" target="_tab">Link</a>
39. Which HTML tag is used to display computer code?
a) <code>
b) <pre>
c) <var>
d) <kbd>

40. What does the HTML <iframe> tag do?


a) It creates an inline frame to embed another document within the current HTML document
b) It defines a container for an image
c) It creates a form for user input
d) It represents a section of a document that contains related content

CSS

41. What does the CSS property "opacity" control?


a) The transparency of an element
b) The size of the element
c) The font of the element
d) The position of the element

42. How do you add a border to an element in CSS?


a) border: 1px solid black;
b) border-style: solid;
c) border-width: 1px;
d) border-color: black;

43. Which CSS property is used to control the space between elements?
a) margin
b) padding
c) space
d) gap

44. What does the CSS property "box-sizing: border-box;" do?


a) It includes the padding and border in the element's total width and height
b) It changes the element's color to black
c) It adds a shadow to the element
d) It makes the element float to the left
45. How can you center an element horizontally in CSS?
a) text-align: center;
b) align: center;
c) margin: auto;
d) position: center;

46. What does the CSS property "flex-direction" define?


a) The direction of the element's border
b) The direction of the element's flex items
c) The direction of the element's text
d) The direction of the element's padding

47. How do you select an element with the id "example" in CSS?


a) .example
b) #example
c) <example>
d) .id-example

48. What is the purpose of the CSS property "z-index"?


a) It controls the visibility of an element
b) It defines the order of overlapping elements
c) It changes the font of the element
d) It aligns the element to the center

49. How do you make text bold in CSS?


a) font-weight: bold;
b) text-style: bold;
c) font-bold: true;
d) style: bold;

50. What does the CSS property "transition" control?


a) It defines a transition effect for an element's style changes
b) It changes the element's color
c) It adds a shadow to the element
d) It controls the element's position

You might also like