what is css?
CSS stands for Cascading Style Sheets. It is used to control how HTML elements look on a web page, including colors, spacing, sizes, layouts, borders, and animations.
what you will learn
- what CSS is and why websites use it
- how to connect CSS with HTML
- the difference between inline, internal, and external CSS
- how selectors, properties, and values work together
basic CSS example
A CSS rule chooses an element and then gives it styles. In this example, every paragraph becomes blue and easier to read.
p {
color: blue;
font-size: 18px;
}
three ways to use css
You can write CSS inside an HTML element, inside the HTML head, or in a separate CSS file. For a real website, a separate CSS file is usually the cleanest choice.
<link rel="stylesheet" href="styles.css">
<style>
p {
color: blue;
font-size: 18px;
}
</style>
<p style="color: blue; font-size: 18px;">This is a blue paragraph.</p>