Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Working with Inline Elements | The CSS Box Model & Spacing Elements
CSS Fundamentals

bookWorking with Inline Elements

Inline elements stay on a single line and wrap to the next line when space runs out. This behavior is controlled by the CSS property display: inline.

Key points about inline elements:

  • They default to display: inline;
  • Their width and height are determined by their content and cannot be explicitly set;
  • Only horizontal properties like padding, margin, and border can be applied.

Let's examine an example where some styles impact the element, while others do not, within the CSS file:

index.html

index.html

index.css

index.css

copy
index.html

index.html

copy

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 9

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Suggested prompts:

Kysy minulta kysymyksiä tästä aiheesta

Tiivistä tämä luku

Näytä käytännön esimerkkejä

Awesome!

Completion rate improved to 2.5

bookWorking with Inline Elements

Pyyhkäise näyttääksesi valikon

Inline elements stay on a single line and wrap to the next line when space runs out. This behavior is controlled by the CSS property display: inline.

Key points about inline elements:

  • They default to display: inline;
  • Their width and height are determined by their content and cannot be explicitly set;
  • Only horizontal properties like padding, margin, and border can be applied.

Let's examine an example where some styles impact the element, while others do not, within the CSS file:

index.html

index.html

index.css

index.css

copy
index.html

index.html

copy

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 9
some-alt