CSS Text Formatting and Styling

GratefulAlliteration avatar
GratefulAlliteration
·
·
Download

Start Quiz

Study Flashcards

13 Questions

Which CSS property is used to specify the font family that should be applied to an element?

font-family

How should multiple font names be separated in CSS?

With commas

Which CSS property sets the size of the text?

font-size

If the font name contains more than one word, how should it be formatted in CSS?

With quotation marks

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

huge

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

700

Which CSS property would you use to make text italic?

font-style

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

leaned

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

950

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

text-decoration-line

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

a { text-decoration: none; }

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

lowercase

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

middle

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: ``

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.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser