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.
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 2
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme