HTML COURSE โข LESSON 13
HTML CSS
CSS stands for Cascading Style Sheets. CSS controls the appearance and layout of HTML pages.
Three Ways to Add CSS
- Inline CSS
- Internal CSS
- External CSS
Inline CSS
Inline CSS is written inside the HTML style attribute.
Inline CSS
<h1 style="color: cyan;">
EDUHUB
</h1>
Internal CSS
Internal CSS is written inside a <style> element in the HTML <head>.
Internal CSS
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: cyan;
}
p {
color: white;
}
</style>
</head>
<body>
<h1>EDUHUB</h1>
<p>Learn HTML.</p>
</body>
</html>
External CSS
External CSS is stored in a separate file.
index.html
<head>
<link
rel="stylesheet"
href="style.css"
>
</head>
style.css
h1 {
color: cyan;
}
p {
font-size: 18px;
}
โญ Best Practice
External CSS is usually the best choice for large websites because the design is easier to manage.