Introduction to CSS: Styling the Web

Learn the basics of CSS, its types, syntax, and how it's used to make web pages attractive and user-friendly.

E
Employee Billianz Academy
Jun 27, 2025 (1 year ago)
2 min read
127 views

What is CSS?

CSS (Cascading Style Sheets) is a stylesheet language used to describe the appearance and layout of HTML elements on a web page. It controls how your website looks on all devices.

Why Use CSS?

  1. Separate content from design
  2. Make sites responsive and mobile-friendly
  3. Add animations and transitions
  4. Create consistent designs across pages
  5. Reduce code repetition with classes and selectors

Types of CSS

There are three main ways to apply CSS to your HTML:

  1. Inline CSS
  2. Directly inside the HTML element using the style attribute.
<p style="color:blue;">Hello CSS</p>
  1. Internal CSS
  2. Inside a <style> tag within the HTML file's <head>.
<style>
p {
color: green;
}
</style>
  1. External CSS
  2. Linked through a separate .css file. Best practice for real-world projects.
<link rel="stylesheet" href="style.css" />

Basic CSS Syntax

selector {
property: value;
}

Example:

body {
background-color: #f5f5f5;
font-family: Arial;
}

Popular CSS Properties

  1. color: Sets text color
  2. background-color: Sets background color
  3. font-size: Controls text size
  4. margin: Space outside an element
  5. padding: Space inside an element
  6. border: Adds borders
  7. width and height: Set dimensions

Selectors in CSS

Selectors target the HTML elements you want to style.

  1. * - Universal selector
  2. p - Element selector
  3. .class-name - Class selector
  4. #id-name - ID selector
  5. div p - Descendant selector

Responsive Design with CSS

Using media queries and flexible units like %, em, and vh, you can make websites look good on all screen sizes.

@media (max-width: 600px) {
body {
background-color: lightblue;
}
}

CSS in Action: Simple Example

<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: red;
text-align: center;
}
p {
font-size: 18px;
}
</style>
</head>
<body>
<h1>Welcome to CSS</h1>
<p>This paragraph is styled using CSS.</p>
</body>
</html>

Conclusion

CSS is the magic that brings life and beauty to your web pages. Whether you're building a portfolio, a landing page, or a full website, CSS gives you the power to control every visual detail.


Stay tuned with Billianz Academy for more beginner-friendly tutorials and real-time projects!

E
Employee
Author at Billianz Academy

Sharing knowledge on cutting-edge technology, full-stack web development, industry trends, and professional career pathways for students and professionals.

Back to Blog
Table of Contents
0
Article Information
  • Category: Tech
  • Published: Jun 27, 2025
  • Reading Time: ~2 minutes
  • Total Views: 127
Upskill Today
Advance Your Tech Career

Master Full-Stack Web Development, Data Analytics, Python, and UI/UX with 100% placement assistance at Billianz Academy.

Quick Share
Continue Reading

Recommended Articles

More insights and tutorials curated for you in this category.

Career Opportunities for MERN Stack Developers Tech
Sep 09, 2026
Career Opportunities for MERN Stack Developers

Explore the career opportunities available for MERN stack developers — job roles, in-demand ski...

4 days ago Read Post
UI vs UX Design: Understanding the Difference, Process, Skills & Career Opportunities Tech
Sep 07, 2026
UI vs UX Design: Understanding the Difference, Process, Skills & Career Opportunities

UI vs UX design explained — key differences, design process, must-have skills, tools, and caree...

6 days ago Read Post
What is Spring Boot? Features, Use Cases, and Why Developers Love It Tech
Sep 02, 2026
What is Spring Boot? Features, Use Cases, and Why Developers Love It

Discover what Spring Boot is, its core features like auto-configuration and embedded servers, a...

1 week ago Read Post

Are you ready for a more great Conversation?