If HTML is the skeleton, CSS (Cascading Style Sheets) is the clothes! Today you'll learn to add style and color to your web pages, transforming them from plain documents into vibrant designs.
CSS is what makes the web beautiful. It allows you to control the look and feel of every element on your page. Mastering CSS is key to creating professional, unique, and engaging websites that people will love to visit.
<style> tag.
CSS rules have three main parts: the Selector (what to style), the Property (how to style it), and the Value (the style to apply).
h1, p,
body
color, font-size
blue, 24px
color, the value could be purple.
Time to be an artist! In the editor on the right, you'll find the HTML code from our last lesson.
Your mission is to add CSS rules inside the <style> tags to make the page
look amazing. Follow these steps:
The preview on the right will update automatically as you type your CSS. Don't be afraid to experiment with different colors and properties!
.container selector in the editor. This targets the div with class="container". Add these properties to create a beautiful light blue box:background: lightblue;padding: 20px;border-radius: 10px;text-align: center;
h1 selector. This targets the main heading. Add these properties to make it purple and use Arial font:color: purple;font-family: Arial;
p selector. This targets all the paragraph text. Add these properties to make it dark blue and larger:color: darkblue;font-size: 18px;
button selector with these properties for a beautiful purple button:background: purple;color: white;padding: 10px 20px;border: none;border-radius: 5px;cursor: pointer;transition: all 0.3s ease;
button:hover selector with these properties for an interactive hover effect:background: darkpurple;transform: scale(1.05);.info selector is already partially completed. Make sure it has these properties for the small gray text:margin-top: 15px;font-size: 14px;color: #777;
Continue to style your "About Me" page. Try to use your favorite colors and fonts. In our next lesson, we'll learn how to use Bootstrap, a popular CSS framework, to make our pages look even more professional with less effort.