Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Text Alignment and Indent | Text Styles
Quizzes & Challenges
Quizzes
Challenges
/
Introduction to CSS Part II

bookText Alignment and Indent

The font properties that we reviewed dealt mainly with how text is styled on a web page. Now, we will move on to the next part of the text styling, where we deal with the text's position and some modifications like underlining or strikethrough.

text-indent

The text-indent property in CSS allows you to specify an element's first line of text indentation. The syntax for the text-indent property is:

element {
  text-indent: <value>;
}

You can specify the indentation using CSS length units (such as pixels, ems, or percentages). For example, to set the text indentation for a paragraph element to 2em, you would use the following code:

index.html

index.html

index.css

index.css

copy

text-align

The text-align property in CSS allows you to specify the alignment of text within an element. The syntax for the text-align property is:

element {
  text-align: left | right | center | justify;
}

Here's an example of how you might use the text-align property to center the text in a div element:

index.html

index.html

index.css

index.css

copy

word-spacing

The word-spacing property in CSS allows you to specify the spacing between words in the text. The syntax for the word-spacing property is:

element {
  word-spacing: <value>;
}

You can specify the word-spacing using CSS length units (such as pixels, ems, or percentages). A positive value will increase the spacing between words, while a negative value will decrease the spacing.

index.html

index.html

index.css

index.css

copy

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 3

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Suggested prompts:

Fragen Sie mich Fragen zu diesem Thema

Zusammenfassen Sie dieses Kapitel

Zeige reale Beispiele

bookText Alignment and Indent

Swipe um das Menü anzuzeigen

The font properties that we reviewed dealt mainly with how text is styled on a web page. Now, we will move on to the next part of the text styling, where we deal with the text's position and some modifications like underlining or strikethrough.

text-indent

The text-indent property in CSS allows you to specify an element's first line of text indentation. The syntax for the text-indent property is:

element {
  text-indent: <value>;
}

You can specify the indentation using CSS length units (such as pixels, ems, or percentages). For example, to set the text indentation for a paragraph element to 2em, you would use the following code:

index.html

index.html

index.css

index.css

copy

text-align

The text-align property in CSS allows you to specify the alignment of text within an element. The syntax for the text-align property is:

element {
  text-align: left | right | center | justify;
}

Here's an example of how you might use the text-align property to center the text in a div element:

index.html

index.html

index.css

index.css

copy

word-spacing

The word-spacing property in CSS allows you to specify the spacing between words in the text. The syntax for the word-spacing property is:

element {
  word-spacing: <value>;
}

You can specify the word-spacing using CSS length units (such as pixels, ems, or percentages). A positive value will increase the spacing between words, while a negative value will decrease the spacing.

index.html

index.html

index.css

index.css

copy

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 3
some-alt