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. How will you make all paragraph elements 'RED' in color ?

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

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. If we want define style for an unique element, then which css selector will we use ?

  • Id
  • element
  • class
  • child

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

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

  • Yes Possible
  • Not possible

6. 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;}

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

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. If we want to show an Arrow as cursor, then which value we will use ?

  • pointer
  • default
  • arrow
  • arr

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

  • wrap
  • push
  • float
  • align

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

  • fixed
  • absolute
  • sticky
  • relative

14. Which is correct CSS syntax?

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

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

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

  • True
  • False

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

  • px
  • em
  • %
  • All work

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

  • p
  • color
  • red
  • None of these

19. How can you make a bulleted list?

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

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

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

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

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

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

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

  • margin
  • padding
  • border
  • All of above

24. What are the 2 supporting chipset?

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

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

  • css
  • Jsp
  • html
  • php

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

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

28. ____________ 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

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

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

30. 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;}

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

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

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

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

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

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

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

35. 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="">

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

  • Input
  • Output
  • Process
  • Light

37. What does CSS stand for?

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

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

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

39. Which is the selector for a link?

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

40. How do you utilize flexbox's properties?

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

41. System is a combination of components working together.

  • True
  • False

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

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

  • Keyword
  • Value
  • Property
  • Length Units

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

45. 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; }
  • None of these

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

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

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

  • p
  • color
  • red
  • All of above

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

  • p
  • color
  • red
  • none of the above

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

  • true
  • false

50. The code for the comment tag in CSS is

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

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.