Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Element Types | Box Model and Layout
CSS Fundamentals
course content

Kursinhalt

CSS Fundamentals

CSS Fundamentals

1. Introduction to CSS
2. Text Styles
3. Box Model and Layout
4. Flexbox
5. Decorative Effects

book
Element Types

Elements in HTML can be classified as inline or block based on their behavior.

  • Inline elements stay on the same line as other elements, only taking up as much width as needed. Examples: <a>, <span>, <img>, <input>;
  • Block elements start on a new line and take up the full width of their container. Examples: <div>, <h1><h6>, <p>, <ul>, <li>.

Block Elements

Block elements occupy the entire width of their container and always start on a new line. They can be styled using CSS properties like width, height, margin, padding, and border. Common examples of block elements include <div>, <p>, <ul>, and <li>.

html

index.html

css

index.css

copy

Inline Elements

Inline elements stay on the same line as other elements and only occupy the width needed for their content. Unlike block elements, inline elements cannot have width, height, margin, or padding values assigned, but border can still be applied. Examples of inline elements include <a>, <span>, <img>, and <input>.

html

index.html

css

index.css

copy

Inline-block Elements

Inline-block elements do not start on a new line but combine the styling flexibility of block elements. They can be customized using CSS properties like width, height, margin, padding, and border. Examples of inline-block elements include <button>, <select>, and <textarea>.

html

index.html

css

index.css

copy

1. What is the main difference between block and inline elements?

2. Which of the following is an example of a block element?

What is the main difference between block and inline elements?

What is the main difference between block and inline elements?

Wählen Sie die richtige Antwort aus

Which of the following is an example of a block element?

Which of the following is an example of a block element?

Wählen Sie die richtige Antwort aus

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 7
We're sorry to hear that something went wrong. What happened?
some-alt