CSS Comments and Font Properties Quiz
30 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which CSS comment style is NOT supported in CSS?

  • /** double asterisk comments **/
  • /* multi-line comments */
  • // double-slash comments (correct)
  • What does the 'font-style' property in CSS enable/disable?

  • Overline style
  • Underline style
  • Italic style (correct)
  • Line-through style
  • Which CSS property determines how large the letters will be drawn on a webpage?

  • letter-spacing
  • text-size
  • font-weight
  • font-size (correct)
  • In CSS, what should you do to enclose multi-word font names?

    <p>Use quotation marks</p> Signup and view all the answers

    Which generic font name ensures that every computer will use a valid font if the first specified font is not found?

    <p>serif</p> Signup and view all the answers

    What unit can be used for specifying font size in CSS?

    <p>pt</p> Signup and view all the answers

    What is the definition of 1 em in terms of font size?

    <p>Equivalent to the font's current size</p> Signup and view all the answers

    Which CSS property is used to adjust the spacing between letters in text?

    <p>word-spacing</p> Signup and view all the answers

    What does the 'font-weight: bold;' CSS property do?

    <p>Makes the text bold</p> Signup and view all the answers

    Which unit of measurement specifies a number of pixels on the screen?

    <p>px</p> Signup and view all the answers

    What is the primary function of 'text-indent' in CSS?

    <p>Indents the first letter of each paragraph</p> Signup and view all the answers

    How is 'text-align' commonly used in CSS?

    <p>To justify text alignment</p> Signup and view all the answers

    What does the link tag in HTML specify?

    <p>The icon to be placed in the browser title bar and bookmark/favorite</p> Signup and view all the answers

    How can a browser locate a specific element on a webpage using an ID?

    <p>By loading the page and scrolling to the element with the given ID</p> Signup and view all the answers

    What is the purpose of the ID attribute in HTML?

    <p>To specify a unique identifier for an element on a page</p> Signup and view all the answers

    What does using an ID selector like #mission in CSS allow you to do?

    <p>Apply specific styles only to elements with that ID</p> Signup and view all the answers

    Why must each page ID be unique in HTML?

    <p>To prevent conflicts when linking to sections of the website</p> Signup and view all the answers

    What is the significance of specifying a link target with an ID at the end preceded by a #?

    <p>It allows browsers to scroll to that element on the page when loaded</p> Signup and view all the answers

    What CSS property is used to define the border thickness and style?

    <p>border</p> Signup and view all the answers

    Which of the following is not a valid border style in CSS?

    <p>line-through</p> Signup and view all the answers

    When specifying width in CSS, which unit can be used?

    <p>pixels</p> Signup and view all the answers

    What does the 'max-width' property in CSS define?

    <p>The maximum allowed width of an element</p> Signup and view all the answers

    Which CSS property is used to set margins on all four sides equally?

    <p>margin</p> Signup and view all the answers

    What does the 'background-color' property in CSS define?

    <p>The color behind the element's content</p> Signup and view all the answers

    What does the CSS context selector 'selector1 > selector2' achieve?

    <p>Applies the given properties to selector2 only if it is directly inside a selector1</p> Signup and view all the answers

    In the CSS Box Model, what does 'margin' represent?

    <p>Space between the border and other content</p> Signup and view all the answers

    What does the CSS property 'border: 5px solid red;' apply in the example given?

    <p>A red border with a width of 5 pixels to all h2 elements</p> Signup and view all the answers

    In the example given, what does 'li strong { text-decoration: underline; }' apply?

    <p>Underlines all strong elements inside li elements</p> Signup and view all the answers

    Which statement best describes applying styles to output n in CSS?

    <p>Output n can have an individual style or ID applied to it</p> Signup and view all the answers

    What does 'HTML #ad li.important strong { text-decoration: underline; }' target in the more complex example?

    <p>'important' class elements inside li elements with an ID of 'ad'</p> Signup and view all the answers

    Study Notes

    Border Properties

    • Border thickness can be specified in px, pt, em, or thin, medium, or thick.
    • Border style can be none, hidden, dotted, dashed, double, groove, inset, outset, ridge, or solid.
    • Border color can be specified.

    Dimensions

    • Width and height properties specify the size of an element.
    • Max-width, max-height, min-width, and min-height properties specify the maximum and minimum size of an element in a given dimension.

    Margins

    • Margin property specifies the margin on all four sides of an element.
    • Margin-bottom, margin-left, margin-right, and margin-top properties specify the margin on a specific side of an element.

    Fonts

    • Font-family property specifies the font to use.
    • Font-size property specifies the size of the font.
    • Font-style property enables or disables italic style.
    • Font-weight property enables or disables bold style.

    Text Properties

    • Text-align property specifies the alignment of text within its element.
    • Text-decoration property specifies decorations such as underlining.
    • Line-height, word-spacing, and letter-spacing properties specify gaps between the various portions of the text.
    • Text-indent property indents the first letter of each paragraph.

    CSS Comments

    • CSS comments are not supported in the same way as programming languages like Java.
    • The // single-line comment style is not supported in CSS.
    • The HTML comment style is not supported in CSS.

    ID Selectors

    • ID selectors apply a style to an element with a unique ID.
    • Each ID must be unique on a page.

    Class Attribute

    • The class attribute has no on-screen appearance, but you can apply a style or ID to it, which will be applied to the text inside the span.

    Context Selectors

    • Context selectors apply properties to an element only if it is inside another element on the page.
    • The > symbol is used to specify a direct child element.

    The CSS Box Model

    • Every element is composed of content, border, padding, and margin.
    • The width and height of an element are calculated by adding the content width/height, padding, border, and margin.

    CSS Properties for Borders

    • Border property can be used to specify the border thickness, style, and color.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your knowledge on CSS comments and font properties with this quiz. Learn about how to select multiple elements and apply styles using CSS. Understand the different font properties like font-family and font-size.

    More Like This

    CSS Basics and Selectors Quiz
    12 questions
    CSS Skills Flashcards
    63 questions

    CSS Skills Flashcards

    WieldyJadeite4115 avatar
    WieldyJadeite4115
    CSS Basics Quiz
    25 questions

    CSS Basics Quiz

    LowCostHarpy avatar
    LowCostHarpy
    CSS Ids and Classes Flashcards
    17 questions
    Use Quizgecko on...
    Browser
    Browser