CBSE Class 6  >  Class 6 Notes  >  CSS for Beginners  >  CSS Introduction

CSS Introduction

What is CSS?

  • CSS is the language we use to style a Web page.
  • CSS stands for Cascading Style Sheets
  • CSS describes how HTML elements are to be displayed on screen, paper, or in other media
  • CSS saves a lot of work. It can control the layout of multiple web pages all at once
  • External stylesheets are stored in CSS files

Why Use CSS?

CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.

CSS Example

body {

  background-color: lightblue;

}

h1 {

  color: white;

  text-align: center;

}

p {

  font-family: verdana;

  font-size: 20px;

}

CSS Solved a Big Problem

  • HTML was NEVER intended to contain tags for formatting a web page!
  • HTML was created to describe the content of a web page, like:
    • <h1>This is a heading</h1>
    • <p>This is a paragraph.</p>
  • When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large websites, where fonts and color information were added to every single page, became a long and expensive process.
  • To solve this problem, the World Wide Web Consortium (W3C) created CSS.
  • CSS removed the style formatting from the HTML page!

CSS Saves a Lot of Work!

  • The style definitions are normally saved in external .css files.
  • With an external stylesheet file, you can change the look of an entire website by changing just one file!
The document CSS Introduction is a part of the Class 6 Course CSS for Beginners.
All you need of Class 6 at this link: Class 6

FAQs on CSS Introduction

1. What exactly is CSS and how does it work with HTML?
Ans. CSS (Cascading Style Sheets) is a language used to style and format the appearance of web pages created with HTML. While HTML provides structure and content, CSS controls colours, fonts, spacing, layouts, and visual design. Together, they work as a pair: HTML builds the framework, and CSS decorates it with styling rules that make websites visually appealing and user-friendly.
2. Why do I need to learn CSS separately if HTML already creates web pages?
Ans. HTML alone creates plain, unstyled web pages with just text and basic structure. CSS enables designers to add professional appearance through colours, typography, positioning, and responsive layouts. Learning CSS separately allows students to master styling techniques independently, making webpages visually engaging and functional across different devices without mixing content and presentation code.
3. What are the three main ways to add CSS styling to a webpage?
Ans. CSS styling can be applied through three methods: inline styles (directly in HTML tags), internal stylesheets (within `<style>` tags in the head section), and external stylesheets (separate .css files linked to HTML). External stylesheets are preferred for larger projects because they keep code organized, allow reusability across multiple pages, and make maintenance easier for web developers.
4. How do CSS selectors help target specific elements on a webpage?
Ans. CSS selectors are patterns used to identify and select HTML elements that need styling. Common types include element selectors (targeting all paragraphs), class selectors (targeting groups with the same class name), and ID selectors (targeting unique elements). Using selectors correctly ensures styling rules apply only to intended elements, preventing unwanted changes and maintaining clean, efficient code structure.
5. What's the difference between classes and IDs in CSS, and when should I use each one?
Ans. Classes are reusable selectors that style multiple elements sharing the same design, while IDs target single, unique elements on a webpage. Use classes for repeated styling (buttons, headings), and IDs for unique components (page header, footer). This distinction helps organize CSS for CBSE Class 6 students learning web design fundamentals, ensuring scalable and maintainable stylesheets for future projects.
Explore Courses for Class 6 exam
Get EduRev Notes directly in your Google search
Related Searches
Summary, Previous Year Questions with Solutions, video lectures, past year papers, Free, MCQs, Sample Paper, CSS Introduction, CSS Introduction, Important questions, pdf , practice quizzes, study material, Semester Notes, shortcuts and tricks, mock tests for examination, Viva Questions, Exam, CSS Introduction, ppt, Objective type Questions, Extra Questions;