0% found this document useful (0 votes)
6 views1 page

CSS Basics Explained

Uploaded by

sehan3061
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

CSS Basics Explained

Uploaded by

sehan3061
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy