By the end of this lesson, you'll be able to:
Make sure you have:
:information_source: Info What are CSS Properties? CSS properties are special commands that tell your web browser how to style HTML elements. Think of them as instructions that make your web page look colorful, organized, and beautiful! In EduBlocks, you'll use special blocks to add these properties to your elements.
:information_source: Info What is CSS Color? CSS Color lets you add beautiful colors to your web page! You can change the color of text, backgrounds, borders, and more. It's like having a digital paintbrush for your website.
Colors make your website:
You can specify colors in three ways:
RGBA stands for Red, Green, Blue, and Alpha:
Here's how it works:
tip Try This! rgba(255, 0, 0, 1) = Bright red (solid) rgba(255, 0, 0, 0.5) = Bright red (half see-through)
Hexadecimal notation uses special six-digit codes to create colors. It's like a secret color language!
How hex codes work:
note Example #FF0066 = Bright pink!
:art: Explore more colors here
Built-in colors are the easiest way to add color! Just type the color name - no numbers needed!
Common built-in colors:
tip Quick Tip Start with built-in colors when you're learning. They're perfect for testing your designs quickly!
:information_source: Info What is CSS Background? CSS Background properties let you decorate the area behind your HTML elements. You can add colors, images, and patterns to make your web pages more interesting!
Here are four powerful background properties you can use:
Property & Block | What It Does |
---|---|
![]() |
Fills the background with a solid color |
![]() |
Adds a picture as the background |
![]() |
Controls if the image repeats like wallpaper |
![]() |
Decides where the background image starts |
note Background Tips
:information_source: Info What is CSS Display? CSS Display controls how elements arrange themselves on your web page. Think of it like organizing toys on a shelf - some sit next to each other, while others need their own shelf!
The display property changes how elements behave. Let's learn about two important types:
Inline :link: | Block :package: |
---|---|
Stays on the same line as other elements | Always starts on a new line |
Example Output ⬅️ Click to see Block ![]() ![]() ![]() |
Example Output ⬅️ Click to see Block ![]() ![]() ![]() |
tip Remember This!
:information_source: Info What are CSS Fonts? CSS Fonts let you change how text looks on your web page. You can make text bigger, smaller, bold, italic, or use different font styles - just like in a word processor!
With CSS fonts, you can control:
Font-family - Choose your text style:
Font-size - Make text bigger or smaller:
note Pro Tip Always provide backup fonts! If the first font isn't available, the browser will use the next one in your list.
:information_source: Info What are Width and Height? Width and height properties control how big or small your HTML elements appear on the page. It's like resizing a picture or a box!
You can set sizes for:
Check out this example: Click to view the code
Sample Code | Output |
---|---|
![]() |
![]() |
tip Size Units Use pixels (px) to set exact sizes. For example:
Great job learning about CSS properties! You now know how to:
:white_check_mark: Add colors using RGBA, hex codes, or color names :white_check_mark: Style backgrounds with colors and images :white_check_mark: Control element layout with display properties :white_check_mark: Change text appearance with font properties :white_check_mark: Set element sizes with width and height
Try these challenges in EduBlocks:
Having issues? Check these common problems:
The CSS properties you learned today are used on every website you visit! When you see:
Keep practicing with EduBlocks, and soon you'll be styling websites like a pro! :art: