Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Fonts | Text Styles
CSS Fundamentals

book
Challenge: Fonts

Task

Let's apply various font properties to specific elements:

For h1:

  • Font family: Arial.

  • Font size: 36px.

  • Font weight: 600.

  • Font style: italic.

For p:

  • Font family: Georgia.

  • Font size: 18px.

  • Font weight: 400.

  • Font style: normal.

html

index.html

css

index.css

copy
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="index.css" />
</head>
<body>
<h1>Welcome to My Website</h1>
<p>
This is an example of text in a paragraph. The font family is set to
Georgia, the font size is 18px, the font weight is normal, and the font
style is also normal.
</p>
</body>
</html>
  • font-family: Specifies the font family.

  • font-size: Defines the font size.

  • font-weight: Sets the font weight.

  • font-style: Specifies the font style.

html

index.html

css

index.css

copy
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="index.css" />
</head>
<body>
<h1>Welcome to My Website</h1>
<p>
This is an example of text in a paragraph. The font family is set to
Georgia, the font size is 18px, the font weight is normal, and the font
style is also normal.
</p>
</body>
</html>

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 6

Fråga AI

expand
ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

some-alt