CSS Text Formatting and Styling

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

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 (A)</p> Signup and view all the answers

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

<p>huge (A)</p> Signup and view all the answers

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

<p>700 (D)</p> Signup and view all the answers

Which CSS property would you use to make text italic?

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

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

<p>leaned (A)</p> Signup and view all the answers

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

<p>950 (B)</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 (B)</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; } (A)</p> Signup and view all the answers

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

<p>lowercase (D)</p> Signup and view all the answers

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

<p>middle (D)</p> Signup and view all the answers

Flashcards are hidden until you start studying

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

More Like This

HTML and CSS Styling Quiz
18 questions
CSS Styling and Selectors Quiz
45 questions

CSS Styling and Selectors Quiz

SensationalNeodymium5444 avatar
SensationalNeodymium5444
HTML Lists and CSS Styling
35 questions

HTML Lists and CSS Styling

RapturousPipeOrgan avatar
RapturousPipeOrgan
CSS Selectors and Styling
19 questions

CSS Selectors and Styling

SereneSerpentine4075 avatar
SereneSerpentine4075
Use Quizgecko on...
Browser
Browser