CSS Text Formatting and Styling
13 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 property is used to specify the font family that should be applied to an element?

  • font-size
  • font-family (correct)
  • font-weight
  • font-style
  • How should multiple font names be separated in CSS?

  • With semicolons
  • With spaces
  • With hyphens
  • With commas (correct)
  • Which CSS property sets the size of the text?

  • font-weight
  • font-style
  • font-family
  • font-size (correct)
  • If the font name contains more than one word, how should it be formatted in CSS?

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

    Which of the following is not a valid value for the CSS font-size property?

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

    What value would you use with the font-weight property to make text bold?

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

    Which CSS property would you use to make text italic?

    <p>font-style</p> Signup and view all the answers

    Which value of the font-style property is not commonly supported?

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

    Which one of these values is not valid for the CSS font-weight property?

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

    Which CSS property is used to apply text decoration such as underline or overline?

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

    How would you turn off underlines that appear automatically under linked text using CSS?

    <p>a { text-decoration: none; }</p> Signup and view all the answers

    What value does the text-transform property need to convert all text to lowercase?

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

    Which of these options is not a valid value for the CSS text-align property?

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

    Study Notes

    CSS Text Formatting

    • CSS text formatting properties include text-align, text-transform, and color properties.

    CSS Styling Font

    • In CSS, fonts are specified using a bundle of font-related properties for typeface, size, weight, and font style.

    The font-family Property

    • Specifies one or more font or generic font family names, separated by commas.
    • Uses a "fallback" system to ensure maximum compatibility between browsers/operating systems.
    • Font names with more than one word must be in quotation marks, e.g. "Times New Roman".

    The font-size Property

    • Specifies the size of the text.
    • Values can be length units (e.g. px), percentages, or predefined values (e.g. xx-small, small, medium, large, etc.).
    • Always use proper HTML tags for headings and paragraphs.

    The font-style Property

    • Specifies italic text.
    • Has three values: normal, italic, and oblique.
    • Oblique is similar to italic but less supported.

    Font Weight (Boldness)

    • Specifies the boldness of text.
    • Values can be normal, bold, bolder, lighter, or a numerical value from 100 to 900.
    • Example: <p style="font-weight:bold;">

    CSS Text Formatting

    • CSS text formatting properties include text-align, text-transform, and color properties.

    CSS Fonts

    • Fonts in CSS are specified using a bundle of font-related properties for typeface, size, weight, and font style.

    The font-family Property

    • The font-family property takes one or more font or generic font family names separated by commas as values.
    • The font names should be separated by commas, and if the font name is more than one word, it must be in quotation marks.
    • Example: p {font-family: "Times New Roman", Times, serif;}

    The font-size Property

    • The font-size property sets the size of the text.
    • Values can be a length unit, percentage, or keyword (xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger).
    • Always use proper HTML tags for headings and paragraphs.
    • Example: h1 {font-size: 40px;} h2 { font-size: 30px;}

    The font-style Property

    • The font-style property specifies italic text.
    • Values can be normal, italic, or oblique.
    • Example: p{font-style: normal;} h1 {font-style: italic;}

    Font Weight (Boldness)

    • The font-weight property adjusts the boldness of type.
    • Values can be normal, bold, bolder, lighter, or a numeric value (100-900).
    • Example: ``

    Studying That Suits You

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

    Quiz Team

    Description

    Learn about CSS properties for text formatting, styling, and font manipulation. Discover how to use text-align, text-transform, color, font-family, and other properties to control the appearance of text.

    More Like This

    CSS Text and Border Color
    24 questions
    HTML CSS Styles Overview
    16 questions
    Use Quizgecko on...
    Browser
    Browser