0% found this document useful (0 votes)
2 views

CSS Basics Explained

Uploaded by

sehan3061
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

CSS Basics Explained

Uploaded by

sehan3061
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSS Basics Explained

CSS basic in small words

CSS (Cascading Style Sheets) is used to style HTML elements on a web page. It controls layout, colors,
fonts, and spacing. Here are the basics:

Selectors

Select elements to style:


`h1 { color: red; }` styles all `<h1>` tags.

Properties and Values

Define styles with property-value pairs:


`color: blue;` changes text color.
`font-size: 16px;` sets text size.

Box Model

Content, padding, border, margin:


These define spacing and layout around elements.

Example

css

div {
background-color: lightblue;
padding: 10px;
margin: 5px;
}

Types of CSS

1. Inline: Inside an HTML tag.


`<p style="color: red;">Text</p>`
2. Internal: Inside `<style>` tags in HTML.
3. External: In a `.css` file linked to HTML.

Let me know if you want to dive deeper!

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 1/1

You might also like