Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Including CSS: Internal Styles | Basic Introduction
Introduction to CSS Part I

book
Including CSS: Internal Styles

There are several ways to include CSS in an HTML document. One way to include CSS in an HTML document is to use the <style> element.

html

index.html

copy
<html>
<head>
<style>
p {
font-size: 14px;
color: red;
}
</style>
</head>
<body>
<p>The paragraph is styled now!</p>
</body>
<html></html>
</html>
  • The advantage of using the <style> element is that it allows you to define styles that apply to the entire document in one place;

  • The disadvantage is that it can make your HTML document challenging to read and maintain since all your styles are mixed in with your HTML code.

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 2

Spørg AI

expand
ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

some-alt