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.
index.html
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<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?
Tak for dine kommentarer!
Sektion 1. Kapitel 2
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat