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

Similar to DW_lesson2 ntro_HTML_CSS_preso ntro_HTML_CSS_preso.ppt (20)

PPTX
Cascading style sheet, CSS Box model, Table in CSS
SherinRappai
 
PPT
Css week11 2020 2021 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
PPTX
Session v(css)
Shrijan Tiwari
 
PDF
Chapter 3 - CSS.pdf
wubiederebe1
 
PPTX
LIS3353 SP12 Week 13
Amanda Case
 
PDF
Css basics
Franc Santos
 
PDF
Css basics
Franc Santos
 
PPT
IP - Lecture 6, 7 Chapter-3 (3).ppt
kassahungebrie
 
PPT
Css week11 2019 2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
PPT
Css class-01
Md Ali Hossain
 
PDF
Introduction to css
nikhilsh66131
 
PPT
Introduction to css by programmerblog.net
Programmer Blog
 
PPTX
CSC PPT 4.pptx
DrRavneetSingh
 
PPTX
Lecture 3CSS part 1.pptx
GmachImen
 
PPT
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
PDF
The CSS Handbook
jackchenvlo
 
PPT
CSS Training in Bangalore
rajkamal560066
 
PPT
css-presentation.ppt
prathur68
 
PPTX
Cascading Styling Sheets(CSS) simple design language intended to transform th...
JebaRaj26
 
Cascading style sheet, CSS Box model, Table in CSS
SherinRappai
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Session v(css)
Shrijan Tiwari
 
Chapter 3 - CSS.pdf
wubiederebe1
 
LIS3353 SP12 Week 13
Amanda Case
 
Css basics
Franc Santos
 
Css basics
Franc Santos
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
kassahungebrie
 
Css week11 2019 2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
Css class-01
Md Ali Hossain
 
Introduction to css
nikhilsh66131
 
Introduction to css by programmerblog.net
Programmer Blog
 
CSC PPT 4.pptx
DrRavneetSingh
 
Lecture 3CSS part 1.pptx
GmachImen
 
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
The CSS Handbook
jackchenvlo
 
CSS Training in Bangalore
rajkamal560066
 
css-presentation.ppt
prathur68
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
JebaRaj26
 

More from YazanMohamed1 (18)

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

Recently uploaded (20)

PPTX
美国学位证(OSU毕业证书)俄亥俄州立大学毕业证书如何办理
Taqyea
 
PPTX
The Costly Mistakes Homeowners Make in Dining Room Renovations
anurag anand
 
PPTX
Project Report on Corrosion (1).pptxkkkk
kaushikpkrishna2024
 
PPTX
www ecommerce web based architecture.pptx
revathi148366
 
PDF
Introductory Plant Pathology Class Slides.pdf
tabishek325
 
PDF
Digital Marketing Expert Training Program
marketing226932
 
PDF
Decorative Glass Dubai /Decorative Glass Dubai
Royal Matrixs
 
PDF
Autodesk Construction Cloud, Revit and forma
AbrahamJacobPanakal1
 
PPTX
Turn prompts into brochures - AI Brochure Generator
Venngage AI Infographic Generator
 
PPTX
search engine optimization123244556.pptx
revathi148366
 
PPTX
Presentationghjgghjhg (11)hcpckxgjt.pptx
ishafarikarbel
 
PPTX
4. PMES PORTFOLIO_BROWN DESIGN_T1-T3_A4.pptx
GynnelNicanor1
 
PDF
GATE-26_AE_Online_CGATE-26_AE_Online_CGATE-26_AE_Online_C
aerom2341
 
PPTX
Untitled presentation (1).pptx testdsaff
David Arbirk
 
PDF
Madrina Brewery - Label design, character design
impybla
 
PPTX
N-doped FSHC 2nrdddddddddddddddddrrrd.pptx
71762306019
 
PDF
inbound6040378307114221962.pdf.dowload...
kayesetinasan
 
PDF
How to Style a Pink Puff-Sleeve Dress for the Ultimate Gen-Z Party Look | Boh...
boheewohee
 
PDF
07/25 - LOUIS VUITTON - DUBAI - UAE_MAURO MANCINI PM ANTEFIXE
Mauro Mancini
 
PDF
Sirisha .A Portfolio.
SirishaSiri487733
 
美国学位证(OSU毕业证书)俄亥俄州立大学毕业证书如何办理
Taqyea
 
The Costly Mistakes Homeowners Make in Dining Room Renovations
anurag anand
 
Project Report on Corrosion (1).pptxkkkk
kaushikpkrishna2024
 
www ecommerce web based architecture.pptx
revathi148366
 
Introductory Plant Pathology Class Slides.pdf
tabishek325
 
Digital Marketing Expert Training Program
marketing226932
 
Decorative Glass Dubai /Decorative Glass Dubai
Royal Matrixs
 
Autodesk Construction Cloud, Revit and forma
AbrahamJacobPanakal1
 
Turn prompts into brochures - AI Brochure Generator
Venngage AI Infographic Generator
 
search engine optimization123244556.pptx
revathi148366
 
Presentationghjgghjhg (11)hcpckxgjt.pptx
ishafarikarbel
 
4. PMES PORTFOLIO_BROWN DESIGN_T1-T3_A4.pptx
GynnelNicanor1
 
GATE-26_AE_Online_CGATE-26_AE_Online_CGATE-26_AE_Online_C
aerom2341
 
Untitled presentation (1).pptx testdsaff
David Arbirk
 
Madrina Brewery - Label design, character design
impybla
 
N-doped FSHC 2nrdddddddddddddddddrrrd.pptx
71762306019
 
inbound6040378307114221962.pdf.dowload...
kayesetinasan
 
How to Style a Pink Puff-Sleeve Dress for the Ultimate Gen-Z Party Look | Boh...
boheewohee
 
07/25 - LOUIS VUITTON - DUBAI - UAE_MAURO MANCINI PM ANTEFIXE
Mauro Mancini
 
Sirisha .A Portfolio.
SirishaSiri487733
 
Ad

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