Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Working with Block-Level Elements | Section
CSS Fundamentals for React Developers - 1768407374224

bookWorking with Block-Level Elements

Block-level elements are rectangular and stack on top of each other, preventing other elements from sharing the same line. This behavior is controlled by the CSS property display: block.

Key points about block-level elements:

  • They default to display: block;
  • Their width spans the full width of the parent container;
  • Their height is determined by the content but can be customized with CSS;
  • They always start on a new line;
  • Properties like border, margin, padding, width, and height can be adjusted.

Let's explore an example where we manipulate width, height, and margin:

index.html

index.html

index.css

index.css

copy

Let's consider how we can center an element inside its parent.

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 24

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

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

bookWorking with Block-Level Elements

Swipe um das Menü anzuzeigen

Block-level elements are rectangular and stack on top of each other, preventing other elements from sharing the same line. This behavior is controlled by the CSS property display: block.

Key points about block-level elements:

  • They default to display: block;
  • Their width spans the full width of the parent container;
  • Their height is determined by the content but can be customized with CSS;
  • They always start on a new line;
  • Properties like border, margin, padding, width, and height can be adjusted.

Let's explore an example where we manipulate width, height, and margin:

index.html

index.html

index.css

index.css

copy

Let's consider how we can center an element inside its parent.

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 24
some-alt