CSS and HTML Styling Fundamentals

Test your knowledge of CSS syntax, properties, and HTML styling including selectors, margins, padding, fonts, colors, and stylesheet integration methods.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)
  1. What is the correct HTML for referring to an external style sheet?
  1. <stylesheet>mystyle.css</stylesheet>
  2. <link rel="stylesheet" type="text/css" href="mystyle.css">
  3. <style src="mystyle.css">
  4. None of the above
Question 2 Multiple Choice (Single Answer)
  1. Where in an HTML document is the correct place to refer to an external style sheet?
  1. At the top of the document
  2. In the <head> section
  3. At the end of the document
  4. In the <body> section
Question 3 Multiple Choice (Single Answer)
  1. Which HTML tag is used to define an internal style sheet?
  1. <style>
  2. <css>
  3. <script>
  4. None of the above
Question 4 Multiple Choice (Single Answer)
  1. Which HTML attribute is used to define inline styles?
  1. style
  2. font
  3. class
  4. styles
Question 5 Multiple Choice (Single Answer)

Which is the correct CSS syntax?

  1. body {color: black}
  2. {body;color:black}
  3. {body:color=black(body}
  4. body:color=black
Question 6 Multiple Choice (Single Answer)

How do you insert a comment in a CSS file?

  1. // this is a comment
  2. /* this is a comment */
  3. // this is a comment //
  4. ' this is a comment
Question 7 Multiple Choice (Single Answer)

How do you add a background color for all

elements?

  1. h1 {background-color:#FFFFFF}
  2. all.h1 {background-color:#FFFFFF}
  3. h1.all {background-color:#FFFFFF}
  4. None of the above
Question 8 Multiple Choice (Single Answer)

How do you change the text color of an element?

  1. fgcolor:
  2. text-color:
  3. color:
  4. text-color=
Question 9 Multiple Choice (Single Answer)

Which CSS property controls the text size?

  1. text-style
  2. text-size
  3. font-size
  4. font-style
Question 10 Multiple Choice (Single Answer)

What is the correct CSS syntax for making all the

elements bold?

  1. <p style="text-size:bold">
  2. p {font-weight:bold}
  3. <p style="font-size:bold">
  4. p {text-size:bold}
Question 11 Multiple Choice (Single Answer)

How do you change the font of an element?

  1. font=
  2. f:
  3. font-family:
  4. None of the above
Question 12 Multiple Choice (Single Answer)

How do you make the text bold?

  1. style:bold
  2. font:b
  3. font-weight:bold
  4. None of the above
Question 13 Multiple Choice (Single Answer)

How do you change the left margin of an element?

  1. indent:
  2. text-indent:
  3. margin-left:
  4. margin:
Question 14 True/False

To define the space between the element's border and content, you use the padding property, but are you allowed to use negative values?

  1. True
  2. False
Question 15 Multiple Choice (Single Answer)

6.What is the fullform of W3C?

  1. (A)World Wide Web Consortium
  2. (B)World Wide Web Company
  3. (C)World Wide Web Center
  4. (D)World Wide Web Command
  5. (E)None of them