CSS Trivia Quiz Test

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Ferkevin04
F
Ferkevin04
Community Contributor
Quizzes Created: 1 | Total Attempts: 447
Questions: 10 | Attempts: 453

SettingsSettingsSettings
CSS Quizzes & Trivia

Questions and Answers
  • 1. 

    What does CSS stand for?

    • A.

      Colorful Style Sheets

    • B.

      Creative Style Sheets

    • C.

      Cascading Style Sheets

    • D.

      Computer Style Sheets

    Correct Answer
    C. Cascading Style Sheets
    Explanation
    CSS stands for Cascading Style Sheets. It is a style sheet language used for describing the presentation of a document written in HTML. CSS allows web designers to control the layout, colors, fonts, and other visual aspects of a webpage. It provides a way to separate the content of a webpage from its presentation, making it easier to maintain and update the design of a website.

    Rate this question:

  • 2. 

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

    • A.

      <style src="mystyle.css" type="text/css"></pre></style>

    • B.

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

    • C.

      <stylesheet>mystyle.css</stylesheet>

    Correct Answer
    B. <link rel="stylesheet" type="text/css" href="mystyle.css">
    Explanation
    The correct HTML for referring to an external style sheet is . This code uses the element with the "rel" attribute set to "stylesheet" to indicate that it is linking to a style sheet. The "type" attribute specifies the MIME type of the linked document, in this case, text/css. The "href" attribute specifies the URL or file path of the external style sheet.

    Rate this question:

  • 3. 

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

    • A.

      In the<body> section

    • B.

      In the<head> section

    • C.

      At the end of the document

    • D.

      T the top of the document

    Correct Answer
    B. In the<head> section
    Explanation
    The correct place to refer to an external style sheet in an HTML document is in the section. This is where the document's metadata and other important information is typically placed, including links to external resources such as style sheets. By placing the reference to the external style sheet in the section, it ensures that the stylesheet is loaded and applied before the content of the document is rendered, allowing for consistent and uniform styling across the entire document.

    Rate this question:

  • 4. 

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

    • A.

      <css>

    • B.

      <script>

    • C.

      <style>

    Correct Answer
    C. <style>
    Explanation
    The correct answer is . This tag is used to define an internal style sheet in HTML. It allows you to write CSS code directly within the HTML document, which can be used to style specific elements or the entire page. By using the tag, you can keep the CSS code separate from the HTML structure, making it easier to maintain and update the styles.

    Rate this question:

  • 5. 

    Which HTML attribute is used to define inline styles?

    • A.

      Style

    • B.

      Class

    • C.

      Styles

    • D.

      Font

    Correct Answer
    A. Style
    Explanation
    The correct answer is "style". The style attribute is used in HTML to define inline styles for an element. Inline styles are used to apply specific styles to individual elements, overriding any external or internal stylesheets. By using the style attribute, developers can specify CSS properties and values directly within the HTML tag, allowing for more precise control over the appearance of the element.

    Rate this question:

  • 6. 

    Which is the correct CSS syntax?

    • A.

      {body;color:black;}

    • B.

      Body {color: black;}

    • C.

      Body:color=black;

    • D.

      {body:color=black;}

    Correct Answer
    B. Body {color: black;}
    Explanation
    The correct CSS syntax is "body {color: black;}". In CSS, selectors are used to target specific HTML elements, and in this case, the "body" selector is used to target the body element of an HTML document. The curly brackets are used to enclose the declaration block, which contains the property and value pairs. In this case, the "color" property is set to "black" to specify the text color of the body element.

    Rate this question:

  • 7. 

    How do you insert 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

    Correct Answer
    C. /* this is a comment */
    Explanation
    In CSS, comments are inserted using the syntax /* comment */. This allows the developer to add explanatory or descriptive notes within the CSS code without affecting the styling. The given answer correctly demonstrates the syntax for inserting a comment in a CSS file.

    Rate this question:

  • 8. 

    Which property is used to change the background color?

    • A.

      Bgcolor

    • B.

      Background-color

    • C.

      Color

    Correct Answer
    B. Background-color
    Explanation
    The property used to change the background color is "background-color". This property allows you to specify a color value that will be applied to the background of an element. By using this property, you can easily customize the background color of a webpage or a specific element within it.

    Rate this question:

  • 9. 

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

    • A.

      H1 {background-color:#FFFFFF;}

    • B.

      H1.all {background-color:#FFFFFF;}

    • C.

      All.h1 {background-color:#FFFFFF;}

    Correct Answer
    A. H1 {background-color:#FFFFFF;}
    Explanation
    The correct answer is "h1 {background-color:#FFFFFF;}". This answer correctly uses the CSS selector "h1" to target all elements and applies the background color property with the value of #FFFFFF, which represents white. This will add a white background color to all elements on the webpage. The other options provided, "h1.all" and "all.h1", are not valid CSS selectors and will not apply the background color to the elements.

    Rate this question:

  • 10. 

    Which CSS property is used to change the text color of an element?

    • A.

      Text-color

    • B.

      Fgcolor

    • C.

      Color

    Correct Answer
    C. Color
    Explanation
    The correct answer is "color". The CSS property "color" is used to change the text color of an element. It allows you to specify the color of the text within the element by using a color name, a hexadecimal code, an RGB value, or other color formats supported by CSS.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 28, 2015
    Quiz Created by
    Ferkevin04
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.