Header Ads

W3Schools CSS Quiz Answers



1. What does CSS stand for?

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


2. What is the correct HTML for referring to an external style sheet?

  • <link rel="stylesheet" type="text/css" href="mystyle.css">
  • <style src="mystyle.css">
  • <stylesheet>mystyle.css</stylesheet>


3. Where in an HTML document is the correct place to refer to an external style sheet?

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


4. Which HTML tag is used to define an internal style sheet?

  • <script>
  • <style>
  • <css>


5. Which HTML attribute is used to define inline styles?

  • font
  • class
  • styles
  • style


6. Which is the correct CSS syntax?

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


7. How do you insert a comment in a CSS file?

  • // this is a comment //
  • ' this is a comment
  • // this is a comment
  • /* this is a comment */

8. Which property is used to change the background color?

  • background-color:
  • bgcolor:
  • color:


9. How do you add a background color for all <h1> elements?


  • h1.all {background-color:#FFFFFF}
  • all.h1 {background-color:#FFFFFF}
  • h1 {background-color:#FFFFFF}


10. How do you change the text color of an element?

  • text-color=
  • color:
  • text-color:
  • fgcolor:


11. Which CSS property controls the text size?

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


12. What is the correct CSS syntax for making all the <p> elements bold?

  • <p style="text-size:bold">
  • <p style="font-size:bold">
  • p {font-weight:bold}
  • p {text-size:bold}
13. How do you display hyperlinks without an underline?

  • a {text-decoration:none}
  • a {underline:none}
  • a {text-decoration:no underline}
  • a {decoration:no underline}
14. How do you make each word in a text start with a capital letter?

  • text-transform:capitalize
  • text-transform:uppercase
  • You can't do that with CSS

15. How do you change the font of an element?

  • font=
  • f:
  • font-family:

16. How do you make the text bold?

  • font-weight:bold
  • font:b
  • style:bold
17. How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1pixel?

  • border-width:5px 20px 10px 1px
  • border-width:10px 20px 5px 1px
  • border-width:10px 5px 20px 1px
  • border-width:10px 1px 5px 20px
18. How do you change the left margin of an element?

  • text-indent:
  • margin:
  • indent:
  • margin-left:
19. To define the space between the element's border and content, you use the padding
property, but are you allowed to use negative values?

  • No
  • Yes


20. How do you make a list that lists its items with squares?

  • type: square
  • type: 2
  • list-type: square
  • list-style-type: square

No comments

Disqus Shortname

Comments system

Powered by Blogger.