Learn CSS for Kids with AI Tools
CSS makes your page look beautiful. You can change colors, make text bigger, add borders, and make a page easy to read on mobile.
Try one change at a time. Save, refresh, and watch what happens.
What is CSS?
CSS stands for Cascading Style Sheets. It is a simple yet powerful language used to style and enhance the appearance of HTML pages. With CSS, you can control the layout, colors, fonts, spacing, and much more, allowing you to create visually appealing and professional-looking web pages.
Types of CSS
CSS can be applied to HTML in several ways, but two primary methods are:
1. External CSS Using style.css external file
2. Internal CSS using <style> Tags
2. Inline CSS
What's Next?
In this tutorial, we will first explore the use of <style> tags to define CSS rules. This approach gives you a solid foundation for understanding how CSS works. Afterward, we will learn about inline styles and their specific use cases.
Note: External CSS will not be covered in this course and is not included in this tutorial.
CSS - Getting Started
Prerequisites for this CSS Tutorial
Before starting with this CSS tutorial, learners should complete the HTML tutorials provided earlier. You will need the index.html file created in the previous lessons.
Step 1: Sit at your computer with this mobile app and open the index.html file from the previous HTML tutorial.
Begin by opening the index.html file in notepad, delete everything and typing the following code:
<html>
<head>
<style></style>
</head>
<body>
<p>I am the author of a short
storybook inspired by Panchatantra
(Written in 300BC),
titled "Five Mechanisms,"
available on Amazon.</p>
</body>
</html>
This code demonstrates how HTML is structured, and the <style> tags are prepared for adding CSS.
Step 2: View the Output
Save the file and open it in your browser to see the plain text output. At this stage, no styles have been applied, and the paragraph will display with the default browser styling.
Step 3: Add Basic CSS Styling
Now, let's use CSS inside the <style> tag to enhance the appearance of the paragraph. CSS is written between the <style> tags, and in this example, we will change the text color to red.
Update the index.html file with the following code:
<html>
<head>
<style>
p {
color: red;
}
</style>
</head>
<body>
<p>
I am the author of a short
storybook inspired by Panchatantra
(Written in 300BC),
titled "Five Mechanisms,"
available on Amazon.</p>
</body>
</html>
Step 4: View the Styled Output
Save the updated file and open it in your browser. You will notice that the text inside the <p> tag is now red, demonstrating how CSS can be used to style HTML elements.
Summary
Using CSS inside the <style> tag allows you to directly define styles for your HTML elements. This example showcases how to modify text color and font weight. Continue experimenting with CSS to explore additional styling options.
Note: Learners can print the PDF files for better understanding and hands-on practice while sitting in front of a computer. Initial stages always type using computer keyboard.
Let’s proceed slowly, and you’ll master all these basics step by step! 🚀
CSS Syntax Explained
The CSS syntax is the way you write CSS rules to style your HTML elements. It follows a simple structure:
Basic Structure of a CSS Rule
A CSS rule consists of three main parts:
- Selector: The element you want to style (e.g.,
<p>for paragraphs,<h1>for headings). - Property: The aspect of the element you want to style (e.g., color, font size, background).
- Value: The specific style you want to apply (e.g.,
redfor color,16pxfor font size).
Example of a CSS Rule
The following example demonstrates a CSS rule:
p {
color: red;
}
Explanation:
p: The selector, targeting all<p>elements.color: The property, specifying the text color to change.red: The value, which changes the text color to red.
CSS Syntax Template
selector {
property: value;
}
Multiple Properties Example
You can apply multiple styles to the same element by listing properties and values:
p {
color: blue;
font-size: 18px;
text-align: center;
}
Inline CSS Example
You can also use inline CSS to style specific elements directly in HTML:
<p style="color: green; font-weight: bold;">This is a paragraph.</p>
Summary
CSS Syntax: The selector decides what to style, the property decides which aspect to change, and the value decides the specific style to apply. CSS syntax is simple and easy to learn!
Step by Step Tutorial : CSS Syntax.Note: I have included advanced tutorials in the PDF file along with a Quick Reference Guide. Learners can skip the advanced tutorials and move on to the next section, "Learn CSS with ChatGPT," as ChatGPT will handle these advanced aspects. However, learning them will be highly beneficial. Remember - Always type or write in notes and do not copy and paste.
Learn CSS with ChatGPT
From this tutorial onwards, you can copy and paste from the ChatGPT results. You do not need to type everything manually.
Step 1: Start by opening ChatGPT. Drag and drop your index.html file (in this example, it contains a paragraph with red-colored text) into the chat window.
Step 2:Once the file is uploaded, type the following:
"I have a html file paragraph with red-colored text. Can you modify it to make the text bold?"
Step 3:ChatGPT will provide a modified version of your code. For example, it might suggest wrapping the paragraph text with a <b> tag or using font-weight: bold; in the CSS. Here’s an example of the updated code:
<html>
<head>
<style>
p {
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<p> What Women Want? |
Isolation and leisure’s
grace, |
Absence of warmth
can shadow her face. ||
True fidelity, born
of respect and insight, |
Grows from understanding,
not external plight.||
150 - Book Title - Five
Mechanisms @ Amazon.
</p>
</body>
</html>
Step 4:Copy the modified code into your index.html file using a text editor like Notepad. Save the file and double-click it to open it in a browser.
Step 5:Keep asking ChatGPT for additional changes or refinements. For example, you can request to:
- Align the text to the center
- Change the font size
- Add other custom styling
This concludes the basic tutorials on ChatGPT and CSS. Next, start learning JavaScript. Keep practicing with small hands-on pages, test each style change in the browser, and ask AI to explain the code in simple words.
Learn HTML, CSS and JS for Kids with AI Tools
These lessons are made for young beginners, including 7-year-old children who want to create simple websites with help from an adult and AI tools.
CSS is exciting because children can immediately see colors, big text, borders, spacing, and layouts change on the screen. That visual feedback makes website design interesting from the beginning.
Practice slowly: change one color, save the file, refresh the browser, and observe what changed. AI tools can explain each CSS line in simple language.
CSS Tools and Learning Resources
Printable PDF Lessons
Choose the PDF you need. Print it or keep it open while practicing.
Detailed Explanation of Each CSS Tag: A free book from Stack Overflow Developers.
CSS
Notes for Professionals
The text content is released under Creative Commons BY-SA.
More professional books are available at https://goalkicker.com
website.
Click on the "Template" link to access professional CSS templates. The "Play" section serves as a testing ground for CSS code, where you can test various CSS tags. Please note that JavaScript are disabled in this environment.