About CSS

Following are some of the multiple choice questions on the CSS with answers that will help the students in developing their knowledge.

CSS MCQ

1. If we want define style for an unique element, then which css selector will we use ?

  • Id
  • element
  • class
  • child

2. By default Hyperlinks are displayed with an underline. How do you remove the underline from all hyperlinks by using CSS code ?

  • a {text: no-underline;}
  • a {text-decoration:none;}
  • a {text-style: no-underline;}
  • a {text-decoration: no-underline;}

3. How will you make all paragraph elements 'RED' in color ?

  • .p.all {color: red;}
  • .* {color: #990000;}
  • all.p {color: #998877;}
  • p {color: red;}

4. Can we align a Block element by setting the left and right margins ?

  • Yes Possible
  • Not possible

5. Using Responsive Web Design (RWD) ensures that site will display correctly in all desktop browsers and mobile devices.You used a grid-based layout and resize-able images, which is another RWD technique that you can use in responsive design?

  • Use relative units, such as percentages, for positioning page elements
  • Use standard page structure elements, including <header>, <footer> and <article>,  because older devices will display content in the structure elements correctly
  • Use static pixels for all content positioning 
  • Use smaller fonts for all body text, to ensure it will appear correctly on smaller screens

6. If we want to wrap a block of text around an image, which css property will we use ?

  • wrap
  • push
  • float
  • align

7. Which of the following is the correct CSS syntax?

  • p:color=green, font-size=15px
  • {p:color=green, font-size=15px}
  • p {color:green, font-size:15px;}
  • p {color:green; font-size:15px;}

8. When we write <img src="img.png">, what "img.png" inside double quote implies?

  • element
  • attribute
  • value
  • operator

9. Which is not a property of attribute Behaviour of <Marquee> tag?

  • alternate
  • blur
  • scroll
  • slide

10. Which CSS code is buggy?

  • link {color: blue;}
  • li {background-color: red;}
  • p {font-size: 10px;}
  • img {width: 100%;}

11. Which css property you will use if you want to add some margin between a DIV's border and its inner text ?

  • spacing
  • margin
  • padding
  • inner-margin

12. The default value of "position" attribute is _________.

  • fixed
  • absolute
  • sticky
  • relative

13. John wants the name of his book to appear in search results for Google. Where should this information beplaced within his webpage?

  • head
  • meta
  • body
  • nav

14. You should always define a backup font-family in CSS.

  • True
  • False

15. What unit of measurement does CSS use for size?

  • px
  • em
  • %
  • All work

16. Which is the value in this CSS?p {color: red;}

  • p
  • color
  • red

17. How can you make a bulleted list?

  • <ol>
  • <ul>
  • <list>
  • <dl>

18. Jerry wants to insert a line break into his webpage. Which code should he use?

  • <ul>
  • <li>
  • <br>
  • <h1>

19. Which tag defines the visible content of a web document?

  • <head>
  • <meta>
  • <title>
  • <body>

20. Which element is used in the section on an HTML page, if we want to use an external style sheet file to decorate the page ?

  • <src>
  • <link>
  • <style>
  • <css>

21. What property changes the inside space of the container?

  • margin
  • padding
  • border
  • All of above

22. What are the 2 supporting chipset?

  • North Bridge Chipset
  • South Bridge Chipset
  • West Bridge Chipset
  • East Bridge Chipset
  • Both A & B

23. When CSS is written inside HTML it will be saved as

  • css
  • Jsp
  • html
  • php

24. Select the code below that uses CSS to configure a background color of #000000 for a web page.

  • body { background-color: #000000; }
  • body { bgcolor: #000000; }
  • document { background¬≠-page: #000000; }
  • None of these

25. A __________ is a protection for any published work that helps to prevent that work from being used without prior authorization.

  • Firewall
  • HTML
  • Copyright
  • CSS Declaration

26. ____________ is a term used to describe how page elements are placed on the screen. For example, elements can be positioned left, right, or center.

  • Attribute
  • Style
  • Alignment
  • Properties

27. A shorthand property used to specify the individual border properties: border-width, border-style and border-color.

  • border-bottom
  • border
  • border-left
  • border-top

28. Which is the correct way to code CSS.

  • p {border-left: 10px dotted orange}
  • p {border-right: 80px gold red;}
  • p {border-right: 80px outset solid;}
  • p {border-right: 80px inset silver;}

29. Which is the value in the CSS code below?h1 {border: 29px solid red}

  • h1
  • { }
  • border
  • 29px solid red

30. Which CSS property is used to control the text size of an element ?

  • font-style
  • text-size
  • font-size
  • text-style

31. What symbols go around the properties for each CSS selector?

  • < >
  • [ ]
  • { }
  • ( )

32. Where in the HTML document is the correct location to insert code to link to your external CSS?

  • In the <head> section
  • In the <body> section
  • At the very end of the document
  • At the very beginning of the document

33. How can you open a link in a new browser window?

  • <a href="url" new>
  • <a href="url" target="new">
  • <a href="url" target="_blank">
  • <a href="url" target="">

34. The Arithmetic Logic Unit handles all the ________ function?

  • Input
  • Output
  • Process
  • Light

35. What does CSS stand for?

  • Creative Style Sheets
  • Cascading Style Sheets
  • Colorful Style Spread
  • Computer Style Spread

36. What are the 4 values of the flex-direction property?

5
  • row | row-reverse | column | column-reverse
  • height | width | number | percent

37. How do you utilize flexbox's properties?

  • display: flex
  • display: on
  • display: show
  • display: image

38. Which is the selector for a link?

5
  • a { }
  • link { }
  • href { }
  • a href { }

39. System is a combination of components working together.

  • True
  • False

40. Will this code works?

h1 {
border-top: 10px dashed violet;
border-top: 25cm double green;
border-top: 60px white inset;
border-top: 30pt solid red;
}
  • YES
  • NO

41. Which is correct CSS syntax?

  • { body; color=black;}
  • body: color= black
  • body {color:black;}
  • (body color is black) 

42. The style that you are applying to a selector, e.g. border.

  • Property
  • Value
  • Keyword
  • Length Units

43. The elements <DIV> and <SPAN> have the following characteristics

  • Element <DIV> inherits properties defined for <SPAN> in a stylesheet
  • Elements <SPAN> and <DIV> define content to be inline or block-level
  • <DIV> and <SPAN> are used as alternatives for the element <P>
  • <DIV> is used inside element <P>.

44. Which is the correct way to specify the color of a paragraph of text?

  • p { color:#ff0000; }
  • p { text-color:#ff0000; }
  • p { font-color: #ff0000; }

45. A selector (ex: h1{ } ) can only have 1 property

  • true
  • false

46. The code for the comment tag in CSS is

  • <!-- comment -->
  • <!-- comment >
  • /* comment /*
  • /* comment */

47. How do I remove the underline from a link using CSS?

  • a {underline: none;}
  • a {text-decoration: none;}
  • a {style: none;}
  • link {underline: none;}

48. Which is the correct way to format a Font Family for a paragraph? (Hint: make sure you have more than one backup font!)

  • p { font-face: Arial, Verdana, San-Serif; }
  • p { font-family: Arial, Verdana, San-Serif; }
  • p { family-font: Arial, Verdana, San-Serif; }
  • p { font: Arial, Verdana, San-Serif; }

49. Which is the property in this CSS?p {color: red;}

  • p
  • color
  • red

50. Which is the Value in the CSS?p {color: red;}

  • p
  • color
  • red

Enjoyed the Quiz. Share this with friends

Comments

Add Your Review

Your email address will not be published.

Subscribe to Newsletter!

Subscribe to get latest updates and information.