CSS
Cascading Style Sheets
CSS
• CSS Stands for “Cascading Style Sheets”.
• CSS is a rule based language that applies styling to your HTML
elements. You write CSS rules in elements, and modify properties
of those elements such as color, background color, width, font
size, etc.
• CSS form the presentation layer of the user interface. It tells the
browser how the element is to be presented to the user.
WHY CSS?
• CSS removes the presentation attributes from the structure
allowing reusability, ease of maintainability, and an
interchangeable presentation layer.
• HTML was never meant to be a presentation language.
• CSS allows us to make global and instantaneous changes easily.
USING STYLE SHEETS
CSS is applied to a web page using three different methods:
 Inline style
 Internal style sheet
 External style sheet
We will be using External Style Sheets.
INLINE STYLE
Applies styles directly to the elements by adding declarations into
the Tags.
<p style=“color: red;”> This is a paragraph </p>
<p style=“font-size: 30px;”> This is another paragraph </p>
INTERNAL STYLE SHEETS
Applies styles to HTML by placing the CSS rules inside the tag
<style> which is written inside the <head> tag.
<head>
<style type=“text/css”>
p{ color: red; }
</style>
</head>
EXTERNAL STYLE SHEETS
Applies styles as a separate file with a .css extension. The file is then
referenced from inside the <head> section by a link to the file.
<head>
<link rel=“stylesheet” type=“text/css” href=“mystyle.css”/>
</head>
Where mystyle.css is the name of my CSS file.
SYNTAX
body { Background-color: black;
color: green; }
Selector
Property Value
Declaration
CSS SELECTORS
CSS selectors are used to "find" (or select) HTML elements based on
their element name, id, class, attribute, and more.
 Element Selector
 ID Selector
ELEMENT SELECTOR
• Element Selector selects based on the element name.
• For Example, You can select all the <p> elements on a page like
this:
p {
color: red;
Text-align: center;
}
All the paragraph on the page will be aligned centered and color will be red.
ID SELECTOR
• The id selector uses the id attribute of an HTML element to select a specific
element.
• The id of an element should be unique within a page, so the id selector is
used to select one unique element!
• To select an element with a specific id, write a hash (#) character, followed by
the id of the element.
<p id=“firstp”> #firstp {
This is a paragraph. color: blue;
</p> }
HTML CSS

More Related Content

PPTX
Cascading Style Sheets (CSS)
PPTX
CSS introduction
PPTX
Week 12 CSS - Review from last week
PPTX
CSS Basic Introduction, Rules, And Tips
PPTX
chitra
PPT
Cascading Style Sheets (CSS) help
PPTX
Session v(css)
PPT
CSS Introduction
Cascading Style Sheets (CSS)
CSS introduction
Week 12 CSS - Review from last week
CSS Basic Introduction, Rules, And Tips
chitra
Cascading Style Sheets (CSS) help
Session v(css)
CSS Introduction

What's hot (18)

PPTX
Cascading style sheets (CSS)
PPT
Introduction to Cascading Style Sheets (CSS)
PDF
Introduction to css
PPTX
PPTX
Css and its types
PPTX
1 03 - CSS Introduction
PPT
Introduction to CSS
PPT
Cascading style sheets
KEY
Lecture2
PPT
Cascading style sheets
PPTX
Welcome to css!
PPTX
Styling of css
PDF
Introduction to CSS
PPTX
The three types of style sheet lesson two fourth quarter fourth year
PPT
Cascading style sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Introduction to css
Css and its types
1 03 - CSS Introduction
Introduction to CSS
Cascading style sheets
Lecture2
Cascading style sheets
Welcome to css!
Styling of css
Introduction to CSS
The three types of style sheet lesson two fourth quarter fourth year

Viewers also liked (7)

DOCX
Advanced data structures using c++ 3
PPT
PPT
4 xml namespaces and xml schema
PDF
6 Steps to Make Your CSS Code More Maintainable
PDF
Efficient, maintainable CSS
ODP
Cascading Style Sheets - Part 01
PPT
Notes DATA STRUCTURE - queue
Advanced data structures using c++ 3
4 xml namespaces and xml schema
6 Steps to Make Your CSS Code More Maintainable
Efficient, maintainable CSS
Cascading Style Sheets - Part 01
Notes DATA STRUCTURE - queue

Similar to Introduction to CSS (20)

PPTX
Cascading style sheet an introduction
PPTX
Cascading style sheet, CSS Box model, Table in CSS
PPTX
Lecture-6.pptx
PPTX
Cascading Styling Sheets(CSS) simple design language intended to transform th...
PPT
working with internet technologies using CSS
PPTX
What is CSS.pptx power point presentation
PPTX
Introduction of css
PPT
Introduction to css by programmerblog.net
PPTX
INTRODUCTIONS OF CSS
PPT
PPTX
cascading style sheets- About cascading style sheets on the selectors
PPTX
Unit 2 WT-CSS.pptx web technology project
PDF
4. Web Technology CSS Basics-1
PPTX
Cashcading stylesheets
PDF
Css tutorial
PPTX
Introduction to CSS
PPTX
it-150608145445-lva1-app6891Unit_3 .pptx
PPTX
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
PPTX
HTML to CSS Basics Exer 2.pptx
Cascading style sheet an introduction
Cascading style sheet, CSS Box model, Table in CSS
Lecture-6.pptx
Cascading Styling Sheets(CSS) simple design language intended to transform th...
working with internet technologies using CSS
What is CSS.pptx power point presentation
Introduction of css
Introduction to css by programmerblog.net
INTRODUCTIONS OF CSS
cascading style sheets- About cascading style sheets on the selectors
Unit 2 WT-CSS.pptx web technology project
4. Web Technology CSS Basics-1
Cashcading stylesheets
Css tutorial
Introduction to CSS
it-150608145445-lva1-app6891Unit_3 .pptx
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
HTML to CSS Basics Exer 2.pptx

More from Ameer Khan (7)

PPTX
Variables and data types in C++
PPTX
Starting c++
PPTX
Introduction to HTML
PPTX
Role of motivation in language learning
PPTX
Personality disorders (Psychology)
PPTX
Self concept in ipc by Ameer Khan
PPT
Self in IPC
Variables and data types in C++
Starting c++
Introduction to HTML
Role of motivation in language learning
Personality disorders (Psychology)
Self concept in ipc by Ameer Khan
Self in IPC

Recently uploaded (20)

PPT
Overviiew on Intellectual property right
PDF
Introduction to c language from lecture slides
PDF
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PDF
State of AI in Business 2025 - MIT NANDA
PDF
Streamline Vulnerability Management From Minimal Images to SBOMs
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
Technical Debt in the AI Coding Era - By Antonio Bianco
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PPTX
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PDF
Domain-specific knowledge and context in large language models: challenges, c...
Overviiew on Intellectual property right
Introduction to c language from lecture slides
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
State of AI in Business 2025 - MIT NANDA
Streamline Vulnerability Management From Minimal Images to SBOMs
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
EIS-Webinar-Regulated-Industries-2025-08.pdf
Technical Debt in the AI Coding Era - By Antonio Bianco
Build automations faster and more reliably with UiPath ScreenPlay
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
Presentation - Principles of Instructional Design.pptx
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
NewMind AI Journal Monthly Chronicles - August 2025
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
Ebook - The Future of AI A Comprehensive Guide.pdf
Domain-specific knowledge and context in large language models: challenges, c...

Introduction to CSS

  • 2. CSS • CSS Stands for “Cascading Style Sheets”. • CSS is a rule based language that applies styling to your HTML elements. You write CSS rules in elements, and modify properties of those elements such as color, background color, width, font size, etc. • CSS form the presentation layer of the user interface. It tells the browser how the element is to be presented to the user.
  • 3. WHY CSS? • CSS removes the presentation attributes from the structure allowing reusability, ease of maintainability, and an interchangeable presentation layer. • HTML was never meant to be a presentation language. • CSS allows us to make global and instantaneous changes easily.
  • 4. USING STYLE SHEETS CSS is applied to a web page using three different methods:  Inline style  Internal style sheet  External style sheet We will be using External Style Sheets.
  • 5. INLINE STYLE Applies styles directly to the elements by adding declarations into the Tags. <p style=“color: red;”> This is a paragraph </p> <p style=“font-size: 30px;”> This is another paragraph </p>
  • 6. INTERNAL STYLE SHEETS Applies styles to HTML by placing the CSS rules inside the tag <style> which is written inside the <head> tag. <head> <style type=“text/css”> p{ color: red; } </style> </head>
  • 7. EXTERNAL STYLE SHEETS Applies styles as a separate file with a .css extension. The file is then referenced from inside the <head> section by a link to the file. <head> <link rel=“stylesheet” type=“text/css” href=“mystyle.css”/> </head> Where mystyle.css is the name of my CSS file.
  • 8. SYNTAX body { Background-color: black; color: green; } Selector Property Value Declaration
  • 9. CSS SELECTORS CSS selectors are used to "find" (or select) HTML elements based on their element name, id, class, attribute, and more.  Element Selector  ID Selector
  • 10. ELEMENT SELECTOR • Element Selector selects based on the element name. • For Example, You can select all the <p> elements on a page like this: p { color: red; Text-align: center; } All the paragraph on the page will be aligned centered and color will be red.
  • 11. ID SELECTOR • The id selector uses the id attribute of an HTML element to select a specific element. • The id of an element should be unique within a page, so the id selector is used to select one unique element! • To select an element with a specific id, write a hash (#) character, followed by the id of the element. <p id=“firstp”> #firstp { This is a paragraph. color: blue; </p> } HTML CSS