CSS (Cascading Style Sheets) is the language used to style and design web pages. While HTML provides the structure, CSS makes the page look beautiful by adding colors, fonts, spacing, and layouts.
Think of CSS like the decorations in a room. HTML is the walls, doors, and windows – CSS is the paint, furniture, and decorations.
CSS was first proposed in 1994 by Håkon Wium Lie. Before CSS, web pages were styled using HTML tags like <font> and <center>!
A CSS rule has two parts: a selector (which element to style) and declarations (the styles to apply).
Create a simple CSS-styled page:
1. Create an HTML page with a heading and a paragraph.
2. Add CSS to make the heading blue and centered.
3. Add CSS to make the paragraph text larger and have a background color.
You've styled your first web page!
Design a "My Favorite Things" webpage using CSS:
Include:
1. A heading with a background color.
2. A list of your favorite things with different colors.
3. Each item with a border and padding.
4. A paragraph with a different font and text color.
Save your page and open it in a browser.
Allah has created the world with beauty and design.
The Qur'an says: "He has made everything beautiful that He has created." (32:7)
When you style web pages, you are creating beauty in the digital world.
Use your skills to create beautiful and useful websites that benefit others.
CSS is used to style web pages with colors, fonts, spacing, and layouts. CSS rules have selectors and declarations. Common properties include color, background-color, font-size, margin, padding, and border. CSS can be inline, internal, or external. CSS makes web pages beautiful and user-friendly.
In Class 6, you were introduced to programming concepts. Now it's time to learn more advanced Python skills, including functions, lists, and dictionaries.
A function is a reusable block of code that performs a specific task. Functions help you avoid repeating code.
A list is a collection of items in order. You can add, remove, and access items in a list.
Python's name comes from the British comedy group Monty Python, not the snake! The creator, Guido van Rossum, was a fan of the show.
A dictionary stores key-value pairs. It's like a real dictionary – you look up a word (key) to find its meaning (value).
Create a Python program with a function and a list:
1. Define a function that takes a list of numbers and returns the sum.
2. Create a list of 5 numbers.
3. Call the function and print the result.
You're coding in Python!
Write a Python program that:
1. Defines a function to calculate the average of a list of numbers.
2. Creates a list of student grades.
3. Calculates and prints the average.
4. Uses a dictionary to store a student's name, age, and favorite subject.
Test your program with different values.
Allah has given us the ability to create and solve problems.
The Qur'an says: "And He taught Adam the names – all of them." (2:31)
Programming is a way of organizing our thoughts and
solving problems in a logical way. Use your coding skills
to make a difference in the world.
Functions are reusable blocks of code that perform specific tasks. Lists are ordered collections of items. Dictionaries store key-value pairs. These concepts are essential for writing efficient and organized Python code. Practice writing functions and using data structures to solve problems.
Computers use different number systems for different purposes. The binary system (base-2) is used internally. Octal (base-8) and hexadecimal (base-16) are used to make binary more readable for humans.
The word "bit" is short for "binary digit". The term was coined by the mathematician John Tukey in 1946.
Binary to Decimal:
1001₂ = 1×8 + 0×4 + 0×2 + 1×1 = 9₁₀
Octal to Decimal:
73₈ = 7×8 + 3×1 = 56 + 3 = 59₁₀
Hex to Decimal:
F3ₓ = 15×16 + 3×1 = 240 + 3 = 243₁₀
Convert these numbers:
1. 1101₂ = _____₁₀
2. 56₈ = _____₁₀
3. 2Aₓ = _____₁₀
4. 100₈ = _____₁₀
5. FFₓ = _____₁₀
Check your answers with a partner.
The different number systems show us how computers organize information.
The Qur'an says: "And everything with Him is by measure." (13:8)
Just as computers use precise systems, Allah has created the universe with
order and precision. Understanding number systems helps us
appreciate this order.
Number systems include binary (base-2), octal (base-8), and hexadecimal (base-16). Binary uses 0 and 1, octal uses 0-7, and hex uses 0-9 and A-F. Each system serves a different purpose in computing. Converting between number systems is a fundamental skill in computer science.
An operating system (OS) is the most important software on a computer. It manages hardware, software, and user interaction. Without an OS, a computer can't do anything.
The first operating system for personal computers was CP/M (Control Program for Microcomputers), created in 1974. MS-DOS and Windows followed later.
Imagine a computer as a busy office. The operating system
is the office manager who:
• Assigns tasks to the right people (CPU management).
• Keeps files organized in filing cabinets (file management).
• Makes sure everyone has the tools they need (device management).
• Answers the phone and greets visitors (user interface).
• Locks the doors at night (security).
The lesson: The operating system is the unsung hero
that makes everything work smoothly on your computer.
Find out which operating system you are using!
1. Check your computer's settings to find the OS name and version.
2. If you have a phone, check what OS it uses.
3. Write down the names of three different operating systems.
4. Compare the features of two different OSs.
Share your findings with the class.
The operating system is like the nervous system of a computer.
Allah has created the human body with a nervous system that coordinates
everything. The Qur'an says: "And He taught man that which he knew not." (96:5)
Just as the body has a system, computers have operating systems.
This is a sign of the wisdom and order in creation.
An operating system manages hardware, software, and user interaction. Key functions include hardware management, file management, process management, user interface, and security. Common operating systems include Windows, macOS, Linux, Android, and iOS. Understanding operating systems helps us use computers more effectively.
A computer network connects computers and devices to share resources, communicate, and exchange information. Networks are the foundation of the modern digital world.
The internet as we know it started in 1983 when the ARPANET adopted the TCP/IP protocol. Before that, different networks couldn't talk to each other!
A network topology is how devices are connected in a network.
What topology does your school use?
In most schools, computers are connected in a star topology.
All the computers connect to a central switch, which connects to the internet.
If one computer fails, the others still work. This is the advantage
of a star topology.
Draw a diagram of a network topology.
Choose one topology: Star, Ring, Bus, or Mesh.
Include:
1. Devices (computers, printers, etc.).
2. Connections (cables or wireless).
3. A central device (if applicable).
Label each part and explain the topology.
Networks connect people across the world. The Qur'an says:
"O mankind, indeed We have created you from male and female and made you peoples
and tribes that you may know one another..." (49:13)
Computer networks are a way to connect and understand each other.
Use this connection to share knowledge and help others.
Computer networks connect devices to share resources and information. Types include PAN, LAN, MAN, and WAN. Topologies include star, ring, bus, and mesh. Understanding networks is essential for understanding how the internet and modern communication work.
Data privacy is the protection of personal information from unauthorized access and misuse. It's about having control over who can see and use your data.
Data privacy laws exist in many countries. The GDPR in Europe is one of the strictest data protection laws in the world, giving people control over their personal data.
A student named Fatima used the same password for her email, social media,
and school account. One day, a website she used was hacked, and the hackers
got her password. They tried the password on other accounts and accessed
her school account.
The school's IT team detected the suspicious activity and blocked the account.
Fatima learned a valuable lesson: always use different passwords
for different accounts.
The lesson: Protecting your data is your responsibility.
Use strong, unique passwords and be careful with your personal information.
Create a "Data Privacy" checklist for yourself.
Include:
1. 3 things you will do to protect your data.
2. 3 things you will stop doing to protect your data.
3. A reminder to review your privacy settings regularly.
Share your checklist with your family.
Allah has entrusted us with responsibilities, including
protecting ourselves and others. The Qur'an says:
"And do not throw yourselves into destruction..." (2:195)
Protecting our data is a form of self-protection.
When we are careful online, we are fulfilling our responsibility
to ourselves and our community.
Data privacy is about protecting personal information. Use strong, unique passwords and two-factor authentication. Think before you share personal information. Digital responsibility means being honest, respectful, and positive online. Protecting your data is a personal and religious responsibility.
You've explored CSS styling, Python programming, number systems, operating systems, computer networks, and data privacy. You are building strong foundations in computer science! May Allah bless your learning and help you use technology for good!