SlideShare a Scribd company logo
INTRO TO CSS
IAT100 Spring 2008
INTRO TO CSS
 Covered in this lesson:
 Overview
 What is CSS?
 Why to use CSS?
 CSS for Skinning your Website
 Structure
 CSS Syntax Introduction
 Three places CSS can be defined
 CSS Syntax Specifics
 Cascading Inheritance
 Applied
 CSS Hands-on
WHAT IS CSS?
 Cascading Style Sheet
 Stylesheet Language
 Standards-based set of properties and attributes to define styles
 To describe the presentation a document written in a
‘markup language’ like HTML or XML
 Markup encoding: <p>My paragraph here.</p>
 Defines the style of how things in <p> tags appear.
 Font, color, size, margins, etc.
 Cascading
 Rules to determine how to
 apply markup that contains
 other markup
WHY CSS?
 Separate Content from Form
 Content is the text and images, marked up to define regions of
specific types
 Form defines the “style” for the content
<font size=“14px”>
My First Header
</font>
<font size=“12px” color=“red” face=“Verdana”>
My information 1 goes here.
</font>
<font size=“14px”>
My Second Header
</font>
<font size=“12px” color=“red” face=“Verdana”>
Different information goes here.
</font>
The old way:
WHY CSS? CONTINUED.
 Separate Content from Form
 Content
 Form or Style
<p class=“header”>My First Header</p>
<p class=“info”>My Information 1 goes here</p>
<p class=“header”>My Second Header</p>
<p class=“info”>Different Information goes here</p>
(Specific markup properties like Class will be discussed later).
.header { font-size:14px;}
.info { font-family: verdana;
font-color: blue;
font-size: 12px; }
WHAT DOES THIS SEPARATION GET US?
 Separate Content from Form
 Specify the style once for every instance of that class.
 Example: Specify the font once for all text on the HTML page that
you’ve identified as a “header”.
 The stylesheet can be a separate file which all HTML pages
on your entire site can link to.
 Only have to specify the style once for your ENITRE SITE
 Can change the style for your entire site by editing only ONE
FILE.
CSS SKINNING
 “Skinning” - changing the look of a page or your site
 Selecting an appearance by choosing which stylesheet to use.
<link rel="stylesheet" type="text/css" href=“skin1.css" />
<p class=“info”>My Information 1 goes here</p>
skin1.css
.info { background-color: White;
font-family: Verdana;
font-color: Blue; }
Some information goes here.
+
=
CSS SKINNING 2
 “Skinning” - changing the look of a page or your site
 Selecting an appearance by choosing which stylesheet to use.
<link rel="stylesheet" type="text/css" href=“skin2.css" />
<p class=“info”>My Information 1 goes here</p>
skin1.css
.info { background-color: Blue;
font-family: Serif;
font-color: White; }
Some information goes here.
+
=
CSS SYNTAX
 3 Elements to a CSS Statement
 Selector
 What HTML sections does it affect?
 Property
 What attribute of that HTML section will be affected?
 Value
 What change will be made to that attribute?
THREE CSS DEFINITION LOCATIONS
 Inline: the “style” attribute
Note, the selector for inline CSS is the tag which contains the style attribute.
 Internal: the <style> markup tag
 External: the .css stylesheet file
<p style=“font-color:red;font-size:10px;”>Content</p>
<html><head><style>
p { background-color: Red;
font-family: serif;
font-color: White; }
</style></head><body>
<p>Content</p>
</body></html>
<link rel="stylesheet" type="text/css" href=“mystylesheet.css" />
CSS SYNTAX: SELECTORS
 There are many kinds of selectors and many ways to reference them:
 Type, Class, ID, Pseudo, etc.
 HTML Type Tag – selected with the tag type
 The Class Attribute – precede the class with a period
p { font-size: 10px;
font-color: White; }
<p>Content</p>
.myinfo { font-size: 10px;
font-color: White; }
<p class=“myinfo”>Content</p>
<div class=“myinfo”>Other content</div>
CASCADING INHERITANCE
 Nested elements inherit
the properties from the
its parent
 If you specify a style for the
<body> tag it will affect all
content in your HTML page.
 If you want to override
inherited settings, you
need to specify a style in
a more local element
body { font-family: Verdana;
font-size: 14px; }
body { font-family: Verdana;
font-size: 1.1em; }
.littletext { font-size: 8px; }
<body>
This text is larger.
<p class=“littletext”>This text is
smaller.</p>
CSS APPLIED
 Hands-on CSS Tutorial

More Related Content

PPTX
Introduction to basics of css, overview, syntax and so on
PPTX
CSS tutorial slides.ppt_20240716_204128_0000.pptx
PPT
Introduction to CSS in HTML.ppt
PDF
CSS Introduction
PPT
Unit 2-CSS & Bootstrap.ppt
PDF
4. Web Technology CSS Basics-1
PPTX
CSS Basics (Cascading Style Sheet)
Introduction to basics of css, overview, syntax and so on
CSS tutorial slides.ppt_20240716_204128_0000.pptx
Introduction to CSS in HTML.ppt
CSS Introduction
Unit 2-CSS & Bootstrap.ppt
4. Web Technology CSS Basics-1
CSS Basics (Cascading Style Sheet)

Similar to DW_lesson2 ntro_HTML_CSS_preso ntro_HTML_CSS_preso.ppt (20)

PPTX
Cascading style sheet, CSS Box model, Table in CSS
PPT
Css week11 2020 2021 for g10 by eng.osama ghandour
PPTX
Session v(css)
PDF
Chapter 3 - CSS.pdf
PPTX
LIS3353 SP12 Week 13
PDF
Css basics
PDF
Css basics
PPT
IP - Lecture 6, 7 Chapter-3 (3).ppt
PPT
Css week11 2019 2020 for g10 by eng.osama ghandour
PPT
Css class-01
PDF
Introduction to css
PPT
Introduction to css by programmerblog.net
PPTX
CSC PPT 4.pptx
PPTX
Lecture 3CSS part 1.pptx
PPT
Introduction to Cascading Style Sheets (CSS)
PDF
The CSS Handbook
PPTX
Module 2 CSS . cascading style sheet and its uses
PPT
CSS Training in Bangalore
PPT
css-presentation.ppt
Cascading style sheet, CSS Box model, Table in CSS
Css week11 2020 2021 for g10 by eng.osama ghandour
Session v(css)
Chapter 3 - CSS.pdf
LIS3353 SP12 Week 13
Css basics
Css basics
IP - Lecture 6, 7 Chapter-3 (3).ppt
Css week11 2019 2020 for g10 by eng.osama ghandour
Css class-01
Introduction to css
Introduction to css by programmerblog.net
CSC PPT 4.pptx
Lecture 3CSS part 1.pptx
Introduction to Cascading Style Sheets (CSS)
The CSS Handbook
Module 2 CSS . cascading style sheet and its uses
CSS Training in Bangalore
css-presentation.ppt
Ad

More from YazanMohamed1 (18)

PPT
css-presentation ntro_HTML_CSS_preso.ppt
PPTX
Data Visualization Fundamentals power.pptx
PPTX
Topic(1)-Intro data mining master ALEX.pptx
PPT
Topic(4)-OLAP data mining master ALEX.ppt
PPTX
IP_ADDRESSING_AND_SUBNETTIN networkG.pptx
PPTX
لإدارة الموارد المستهلكة من حيث البيع والشراء.pptx
PPTX
IP Addrass and classes Network and security.pptx
PPTX
Stats - 01.pptx IP_Classes_Explanation.pptx network and suc
PPTX
IP_Classes_Explanation.pptx network and suc
PPTX
PHP_Associative_Array.pptx php languages
PPTX
KNIME_Overview_Presentation data mining tools
PPTX
Title Lorem Ipsum [Autosaved].pptx
PPTX
Title Lorem Ipsum.pptx
PPTX
PERFECT COMPETITION.pptx
PPTX
production Analysis ch4.pptx
PDF
Computer Aided Software Engineering (CASE).pdf
PDF
ACTION DESIGN RESEARCH.pdf
PPTX
STUDENT AFFAIRS MANAGEMENT SYSTEM.pptx
css-presentation ntro_HTML_CSS_preso.ppt
Data Visualization Fundamentals power.pptx
Topic(1)-Intro data mining master ALEX.pptx
Topic(4)-OLAP data mining master ALEX.ppt
IP_ADDRESSING_AND_SUBNETTIN networkG.pptx
لإدارة الموارد المستهلكة من حيث البيع والشراء.pptx
IP Addrass and classes Network and security.pptx
Stats - 01.pptx IP_Classes_Explanation.pptx network and suc
IP_Classes_Explanation.pptx network and suc
PHP_Associative_Array.pptx php languages
KNIME_Overview_Presentation data mining tools
Title Lorem Ipsum [Autosaved].pptx
Title Lorem Ipsum.pptx
PERFECT COMPETITION.pptx
production Analysis ch4.pptx
Computer Aided Software Engineering (CASE).pdf
ACTION DESIGN RESEARCH.pdf
STUDENT AFFAIRS MANAGEMENT SYSTEM.pptx
Ad

Recently uploaded (20)

PPTX
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
DOCX
actividad 20% informatica microsoft project
PDF
Interior Structure and Construction A1 NGYANQI
PPTX
Wisp Textiles: Where Comfort Meets Everyday Style
PDF
YOW2022-BNE-MinimalViableArchitecture.pdf
PPT
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
PPTX
Fundamental Principles of Visual Graphic Design.pptx
PPT
UNIT I- Yarn, types, explanation, process
PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PDF
Urban Design Final Project-Context
PPTX
HPE Aruba-master-icon-library_052722.pptx
PDF
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
DOCX
The story of the first moon landing.docx
PPT
pump pump is a mechanism that is used to transfer a liquid from one place to ...
PPTX
AD Bungalow Case studies Sem 2.pptxvwewev
PPTX
areprosthodontics and orthodonticsa text.pptx
PDF
Urban Design Final Project-Site Analysis
PPTX
joggers park landscape assignment bandra
PPTX
Tenders & Contracts Works _ Services Afzal.pptx
AC-Unit1.pptx CRYPTOGRAPHIC NNNNFOR ALL
actividad 20% informatica microsoft project
Interior Structure and Construction A1 NGYANQI
Wisp Textiles: Where Comfort Meets Everyday Style
YOW2022-BNE-MinimalViableArchitecture.pdf
WHY_R12 Uaafafafpgradeaffafafafaffff.ppt
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
Fundamental Principles of Visual Graphic Design.pptx
UNIT I- Yarn, types, explanation, process
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
Urban Design Final Project-Context
HPE Aruba-master-icon-library_052722.pptx
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
The story of the first moon landing.docx
pump pump is a mechanism that is used to transfer a liquid from one place to ...
AD Bungalow Case studies Sem 2.pptxvwewev
areprosthodontics and orthodonticsa text.pptx
Urban Design Final Project-Site Analysis
joggers park landscape assignment bandra
Tenders & Contracts Works _ Services Afzal.pptx

DW_lesson2 ntro_HTML_CSS_preso ntro_HTML_CSS_preso.ppt

  • 1. INTRO TO CSS IAT100 Spring 2008
  • 2. INTRO TO CSS  Covered in this lesson:  Overview  What is CSS?  Why to use CSS?  CSS for Skinning your Website  Structure  CSS Syntax Introduction  Three places CSS can be defined  CSS Syntax Specifics  Cascading Inheritance  Applied  CSS Hands-on
  • 3. WHAT IS CSS?  Cascading Style Sheet  Stylesheet Language  Standards-based set of properties and attributes to define styles  To describe the presentation a document written in a ‘markup language’ like HTML or XML  Markup encoding: <p>My paragraph here.</p>  Defines the style of how things in <p> tags appear.  Font, color, size, margins, etc.  Cascading  Rules to determine how to  apply markup that contains  other markup
  • 4. WHY CSS?  Separate Content from Form  Content is the text and images, marked up to define regions of specific types  Form defines the “style” for the content <font size=“14px”> My First Header </font> <font size=“12px” color=“red” face=“Verdana”> My information 1 goes here. </font> <font size=“14px”> My Second Header </font> <font size=“12px” color=“red” face=“Verdana”> Different information goes here. </font> The old way:
  • 5. WHY CSS? CONTINUED.  Separate Content from Form  Content  Form or Style <p class=“header”>My First Header</p> <p class=“info”>My Information 1 goes here</p> <p class=“header”>My Second Header</p> <p class=“info”>Different Information goes here</p> (Specific markup properties like Class will be discussed later). .header { font-size:14px;} .info { font-family: verdana; font-color: blue; font-size: 12px; }
  • 6. WHAT DOES THIS SEPARATION GET US?  Separate Content from Form  Specify the style once for every instance of that class.  Example: Specify the font once for all text on the HTML page that you’ve identified as a “header”.  The stylesheet can be a separate file which all HTML pages on your entire site can link to.  Only have to specify the style once for your ENITRE SITE  Can change the style for your entire site by editing only ONE FILE.
  • 7. CSS SKINNING  “Skinning” - changing the look of a page or your site  Selecting an appearance by choosing which stylesheet to use. <link rel="stylesheet" type="text/css" href=“skin1.css" /> <p class=“info”>My Information 1 goes here</p> skin1.css .info { background-color: White; font-family: Verdana; font-color: Blue; } Some information goes here. + =
  • 8. CSS SKINNING 2  “Skinning” - changing the look of a page or your site  Selecting an appearance by choosing which stylesheet to use. <link rel="stylesheet" type="text/css" href=“skin2.css" /> <p class=“info”>My Information 1 goes here</p> skin1.css .info { background-color: Blue; font-family: Serif; font-color: White; } Some information goes here. + =
  • 9. CSS SYNTAX  3 Elements to a CSS Statement  Selector  What HTML sections does it affect?  Property  What attribute of that HTML section will be affected?  Value  What change will be made to that attribute?
  • 10. THREE CSS DEFINITION LOCATIONS  Inline: the “style” attribute Note, the selector for inline CSS is the tag which contains the style attribute.  Internal: the <style> markup tag  External: the .css stylesheet file <p style=“font-color:red;font-size:10px;”>Content</p> <html><head><style> p { background-color: Red; font-family: serif; font-color: White; } </style></head><body> <p>Content</p> </body></html> <link rel="stylesheet" type="text/css" href=“mystylesheet.css" />
  • 11. CSS SYNTAX: SELECTORS  There are many kinds of selectors and many ways to reference them:  Type, Class, ID, Pseudo, etc.  HTML Type Tag – selected with the tag type  The Class Attribute – precede the class with a period p { font-size: 10px; font-color: White; } <p>Content</p> .myinfo { font-size: 10px; font-color: White; } <p class=“myinfo”>Content</p> <div class=“myinfo”>Other content</div>
  • 12. CASCADING INHERITANCE  Nested elements inherit the properties from the its parent  If you specify a style for the <body> tag it will affect all content in your HTML page.  If you want to override inherited settings, you need to specify a style in a more local element body { font-family: Verdana; font-size: 14px; } body { font-family: Verdana; font-size: 1.1em; } .littletext { font-size: 8px; } <body> This text is larger. <p class=“littletext”>This text is smaller.</p>
  • 13. CSS APPLIED  Hands-on CSS Tutorial