SlideShare uma empresa Scribd logo
1 de 23
CSS: Modern
Layout and Style
MODERN SCRIPTING
What is CSS?


It is a language that defines how page elements
marked up with HTML or XHTML are displayed in
the web browser or on other devices.



Example, how a page is printed.



CSS is like a “template” that defines the way
that each HTML element looks when displayed.
CSS 1


It became a recommendation in December
1996



It mainly provides methods of styling text- thus
replacing the <font> tag. Which is deprecated
in HTML 4.
Lets try this:
<html>
<head>
<title>Unstyled Example</title>
</head>
<body>
<h1>hello world!</h1>

<p>This is Structural XHTML</p>
</body>
</html>
Output of Code
Same Code but with external
sheet(using the link element)
<html>
<head>
<title>CSS Example</title>

<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<h1>hello world!</h1>
<p>This is Structural XHTML</p>
</body>
</html>
Whats inside the test.css link?
h1 {
color:#339900;
background-color: Transparent;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
}
p{
color:#003399;

background-color: Transparent;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
}
Output of the two Codes
What was inside the CSS file?


The mark up consists of two rule sets, one for h1
(text within <h1></h1> tags)



And one for p (text within <p></p> tags).
Lets examine the code


Each of the rule sets consists of the selector (for example,
h1 or p)



A pair of curly braces ( { } )



Inside the curly braces are the directives, which states
how you wish the selector to be displayed in the screen



The directive themselves consist of property and value
combinations separated by a colon (:).



In English, you are saying “this is what to change , and
this is the value I want to change it to”.
Defining Styles


You only need to define how you want your tags
to be styled once.



If further <h1> and <p> elements are added to
the HTML documents, they will also be styled by
the CSS.
CSS in NotePad


You may use the NotePad in encoding the
stylesheet that you want to use in your CSS file.



Once that you defined the stylesheet, you can
save it using the extension name .css like the one
we used in the example “text.css”.
CSS2


It became a recommendation in May 1998



It builds on the CSS1 specification, adding
support for positioning elements (meaning
images, blocks of text, or other items on your
pages) and support for different “media
descriptors”.
CSS3


It is still in development and brings with a new,
modular, approach to CSS in order that devices
that do not have the capability to support the
entire specification can support necessary
modules.



As of November 2011, there are over 50 CSS
modules published from the CSS Working Group.
Some of these are Selectors, Namspaces and
Color and are all recommended by the W3C in
2011.
Separating Document Structures
from Presentation


Document structure includes your content, marked up in a logical
way by the us of tags that describe the content‟s meaning rather
than how it should be displayed. This include paragraphs (<p>),
heading levels (h1 to h6), line breaks (<br />), references to image
files (<img>), hyperlinks to other documents (<a>) and divs and
spans (<div> and <span>)



Presentation means any way of describing how the document
structure should be displayed. This is the whole purpose of CSS, but
in HTML this includes color attributes, align attributes, <center>
elements, and <font> elements.
Ways of Implementing CSS




Inline CSS
Embedded CSS
External Stylesheet
Inline CSS


These are applied to one page element at a time within the flow of
the document. They use a style attribute with a value equal to the
declaration part of the rules below:



<h1 style="color:sienna;margin-left:20px;">This is a paragraph.</h1>



This style will only effect this heading and if you make another, you
have to type again the code.



An inline style loses many of the advantages of style sheets by
mixing content with presentation. Use this method sparingly!
Embedded CSS


Is one that is placed within a <style> element
between the <head> and the </head> tags of a
document.



The style rules described in it will only affect that
particular document.
Embedded CSS
<html>
<head>
<title>Embedded CSS Example</title>
<style type=“text/css”>
h2 {
Font-family: Verdana, Arial, Helvetica, sans-serif;
Color:#cc99cc;
}

</style>
</head>
<body>
<h2>
Text to be styled

</h2>
</body>
</html>
External Stylesheets


This style allows you to fully benefit from CSS.



To make an external stylesheet, you simply take
a simple style rules and place them into a file
with the extension name „.css‟ then link it to the
document you want it affected.
h2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #cc99cc;

}


Save it as global.css,
then attach it to your document by adding the
follow line code between <head></head> tags of
your HTML document:
<html>
<head>
<title> External CSS Example</title>

<link rel="stylesheet" type="text/css" href="global.css" />
</head>
<body>
<h2>
Text to be styled using the external stylesheet.
</h2>
</body>
</html>

Mais conteúdo relacionado

Mais procurados

Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Marc Steel
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
Jafar Nesargi
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
Jafar Nesargi
 

Mais procurados (20)

Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Session v(css)
Session v(css)Session v(css)
Session v(css)
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Introduction to css & its attributes with syntax
Introduction to css & its attributes with syntaxIntroduction to css & its attributes with syntax
Introduction to css & its attributes with syntax
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Week 12 CSS - Review from last week
Week 12 CSS - Review from last weekWeek 12 CSS - Review from last week
Week 12 CSS - Review from last week
 
Html, css and jquery introduction
Html, css and jquery introductionHtml, css and jquery introduction
Html, css and jquery introduction
 
HTML and CSS
HTML and CSSHTML and CSS
HTML and CSS
 
Basic HTML/CSS
Basic HTML/CSSBasic HTML/CSS
Basic HTML/CSS
 
CSS
CSS CSS
CSS
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Styling of css
Styling of cssStyling of css
Styling of css
 
Cascading Style Sheets - CSS - Tutorial
Cascading Style Sheets - CSS  -  TutorialCascading Style Sheets - CSS  -  Tutorial
Cascading Style Sheets - CSS - Tutorial
 

Destaque

Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
Akash Varaiya
 
Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010
Cathie101
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and Dimensions
Gerson Abesamis
 
Introduction to computers new 2010
Introduction to computers new 2010Introduction to computers new 2010
Introduction to computers new 2010
Cyrus Kyle
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
 

Destaque (20)

Css page layout
Css page layoutCss page layout
Css page layout
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
Page Layout 2010
Page Layout 2010Page Layout 2010
Page Layout 2010
 
The Box Model [CSS Introduction]
The Box Model [CSS Introduction]The Box Model [CSS Introduction]
The Box Model [CSS Introduction]
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and Dimensions
 
Css box-model
Css box-modelCss box-model
Css box-model
 
Introduction to computers new 2010
Introduction to computers new 2010Introduction to computers new 2010
Introduction to computers new 2010
 
The CSS Box Model
The CSS Box ModelThe CSS Box Model
The CSS Box Model
 
End User Computing (EUC)
End User Computing (EUC)End User Computing (EUC)
End User Computing (EUC)
 
Introduction To Computers
Introduction To ComputersIntroduction To Computers
Introduction To Computers
 
CSS Layout Techniques
CSS Layout TechniquesCSS Layout Techniques
CSS Layout Techniques
 
Chapter 01 - Introduction to Computers
Chapter 01 - Introduction to ComputersChapter 01 - Introduction to Computers
Chapter 01 - Introduction to Computers
 
CSS Box Model Presentation
CSS Box Model PresentationCSS Box Model Presentation
CSS Box Model Presentation
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
 
Css box model
Css  box modelCss  box model
Css box model
 
CSS Layouting #3 : Box Model
CSS Layouting #3 : Box ModelCSS Layouting #3 : Box Model
CSS Layouting #3 : Box Model
 
Template & Content Control (Basics) - Microsoft Word 2013
Template & Content Control (Basics) - Microsoft Word 2013Template & Content Control (Basics) - Microsoft Word 2013
Template & Content Control (Basics) - Microsoft Word 2013
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
Introduction to computers pdf
Introduction to computers pdfIntroduction to computers pdf
Introduction to computers pdf
 

Semelhante a Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style

This is css which compiled by alex that is impo
This is css which compiled by alex that is impoThis is css which compiled by alex that is impo
This is css which compiled by alex that is impo
AlebelAyalneh
 
Using Cascading Style Sheets2
Using Cascading Style Sheets2Using Cascading Style Sheets2
Using Cascading Style Sheets2
Sutinder Mann
 
Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10
Sutinder Mann
 

Semelhante a Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style (20)

CSS Training in Bangalore
CSS Training in BangaloreCSS Training in Bangalore
CSS Training in Bangalore
 
Css
CssCss
Css
 
Cashcading stylesheets
Cashcading stylesheetsCashcading stylesheets
Cashcading stylesheets
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
 
Css inclusion
Css   inclusionCss   inclusion
Css inclusion
 
Css
CssCss
Css
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
HTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxHTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptx
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
This is css which compiled by alex that is impo
This is css which compiled by alex that is impoThis is css which compiled by alex that is impo
This is css which compiled by alex that is impo
 
Full
FullFull
Full
 
Using Cascading Style Sheets2
Using Cascading Style Sheets2Using Cascading Style Sheets2
Using Cascading Style Sheets2
 
Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10
 
lecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptxlecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptx
 
Css notes
Css notesCss notes
Css notes
 
Css basics
Css basicsCss basics
Css basics
 
Css basics
Css basicsCss basics
Css basics
 
Css introduction
Css  introductionCss  introduction
Css introduction
 

Mais de Perry Mallari

Film making fourth quarter lesson 2 third year
Film making  fourth quarter lesson 2 third yearFilm making  fourth quarter lesson 2 third year
Film making fourth quarter lesson 2 third year
Perry Mallari
 
Lesson 3 second year fourth quarter s
Lesson 3 second year fourth quarter sLesson 3 second year fourth quarter s
Lesson 3 second year fourth quarter s
Perry Mallari
 
Second lesson for first year
Second lesson for first yearSecond lesson for first year
Second lesson for first year
Perry Mallari
 
Part two second year
Part two second yearPart two second year
Part two second year
Perry Mallari
 
Pointers for all year level 4th monthly test
Pointers for all year level 4th monthly testPointers for all year level 4th monthly test
Pointers for all year level 4th monthly test
Perry Mallari
 
Part two second year
Part two second yearPart two second year
Part two second year
Perry Mallari
 
Sources for audio lesson two second year fourt quarter
Sources for audio lesson two second year fourt quarterSources for audio lesson two second year fourt quarter
Sources for audio lesson two second year fourt quarter
Perry Mallari
 
Second year Lesson Two sources of sound
Second year Lesson Two sources of soundSecond year Lesson Two sources of sound
Second year Lesson Two sources of sound
Perry Mallari
 
The three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth yearThe three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth year
Perry Mallari
 
Lesson One Fourth QuarterThird Year High School Film Making
Lesson One Fourth QuarterThird Year High School Film MakingLesson One Fourth QuarterThird Year High School Film Making
Lesson One Fourth QuarterThird Year High School Film Making
Perry Mallari
 
Lesson One Fourth Quarter First Year High School Running A Presentation
Lesson One Fourth Quarter First Year High School Running A PresentationLesson One Fourth Quarter First Year High School Running A Presentation
Lesson One Fourth Quarter First Year High School Running A Presentation
Perry Mallari
 
Lesson One Fourth Quarter Second Year High School Understanding Sounds
Lesson One Fourth Quarter Second Year High School Understanding SoundsLesson One Fourth Quarter Second Year High School Understanding Sounds
Lesson One Fourth Quarter Second Year High School Understanding Sounds
Perry Mallari
 

Mais de Perry Mallari (14)

Film making fourth quarter lesson 2 third year
Film making  fourth quarter lesson 2 third yearFilm making  fourth quarter lesson 2 third year
Film making fourth quarter lesson 2 third year
 
Lesson 3 second year fourth quarter s
Lesson 3 second year fourth quarter sLesson 3 second year fourth quarter s
Lesson 3 second year fourth quarter s
 
Second lesson for first year
Second lesson for first yearSecond lesson for first year
Second lesson for first year
 
Slide Design
Slide DesignSlide Design
Slide Design
 
Part two second year
Part two second yearPart two second year
Part two second year
 
Pointers for all year level 4th monthly test
Pointers for all year level 4th monthly testPointers for all year level 4th monthly test
Pointers for all year level 4th monthly test
 
Part two second year
Part two second yearPart two second year
Part two second year
 
Q and a god father
Q and a god fatherQ and a god father
Q and a god father
 
Sources for audio lesson two second year fourt quarter
Sources for audio lesson two second year fourt quarterSources for audio lesson two second year fourt quarter
Sources for audio lesson two second year fourt quarter
 
Second year Lesson Two sources of sound
Second year Lesson Two sources of soundSecond year Lesson Two sources of sound
Second year Lesson Two sources of sound
 
The three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth yearThe three types of style sheet lesson two fourth quarter fourth year
The three types of style sheet lesson two fourth quarter fourth year
 
Lesson One Fourth QuarterThird Year High School Film Making
Lesson One Fourth QuarterThird Year High School Film MakingLesson One Fourth QuarterThird Year High School Film Making
Lesson One Fourth QuarterThird Year High School Film Making
 
Lesson One Fourth Quarter First Year High School Running A Presentation
Lesson One Fourth Quarter First Year High School Running A PresentationLesson One Fourth Quarter First Year High School Running A Presentation
Lesson One Fourth Quarter First Year High School Running A Presentation
 
Lesson One Fourth Quarter Second Year High School Understanding Sounds
Lesson One Fourth Quarter Second Year High School Understanding SoundsLesson One Fourth Quarter Second Year High School Understanding Sounds
Lesson One Fourth Quarter Second Year High School Understanding Sounds
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

Lesson One Fourth Quarter Fourth Year High School CSS Modern Layout and Style

  • 1. CSS: Modern Layout and Style MODERN SCRIPTING
  • 2. What is CSS?  It is a language that defines how page elements marked up with HTML or XHTML are displayed in the web browser or on other devices.  Example, how a page is printed.  CSS is like a “template” that defines the way that each HTML element looks when displayed.
  • 3. CSS 1  It became a recommendation in December 1996  It mainly provides methods of styling text- thus replacing the <font> tag. Which is deprecated in HTML 4.
  • 4. Lets try this: <html> <head> <title>Unstyled Example</title> </head> <body> <h1>hello world!</h1> <p>This is Structural XHTML</p> </body> </html>
  • 6. Same Code but with external sheet(using the link element) <html> <head> <title>CSS Example</title> <link rel="stylesheet" type="text/css" href="test.css" /> </head> <body> <h1>hello world!</h1> <p>This is Structural XHTML</p> </body> </html>
  • 7. Whats inside the test.css link? h1 { color:#339900; background-color: Transparent; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; } p{ color:#003399; background-color: Transparent; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; }
  • 8. Output of the two Codes
  • 9. What was inside the CSS file?  The mark up consists of two rule sets, one for h1 (text within <h1></h1> tags)  And one for p (text within <p></p> tags).
  • 10. Lets examine the code  Each of the rule sets consists of the selector (for example, h1 or p)  A pair of curly braces ( { } )  Inside the curly braces are the directives, which states how you wish the selector to be displayed in the screen  The directive themselves consist of property and value combinations separated by a colon (:).  In English, you are saying “this is what to change , and this is the value I want to change it to”.
  • 11. Defining Styles  You only need to define how you want your tags to be styled once.  If further <h1> and <p> elements are added to the HTML documents, they will also be styled by the CSS.
  • 12. CSS in NotePad  You may use the NotePad in encoding the stylesheet that you want to use in your CSS file.  Once that you defined the stylesheet, you can save it using the extension name .css like the one we used in the example “text.css”.
  • 13. CSS2  It became a recommendation in May 1998  It builds on the CSS1 specification, adding support for positioning elements (meaning images, blocks of text, or other items on your pages) and support for different “media descriptors”.
  • 14. CSS3  It is still in development and brings with a new, modular, approach to CSS in order that devices that do not have the capability to support the entire specification can support necessary modules.  As of November 2011, there are over 50 CSS modules published from the CSS Working Group. Some of these are Selectors, Namspaces and Color and are all recommended by the W3C in 2011.
  • 15. Separating Document Structures from Presentation  Document structure includes your content, marked up in a logical way by the us of tags that describe the content‟s meaning rather than how it should be displayed. This include paragraphs (<p>), heading levels (h1 to h6), line breaks (<br />), references to image files (<img>), hyperlinks to other documents (<a>) and divs and spans (<div> and <span>)  Presentation means any way of describing how the document structure should be displayed. This is the whole purpose of CSS, but in HTML this includes color attributes, align attributes, <center> elements, and <font> elements.
  • 16. Ways of Implementing CSS    Inline CSS Embedded CSS External Stylesheet
  • 17. Inline CSS  These are applied to one page element at a time within the flow of the document. They use a style attribute with a value equal to the declaration part of the rules below:  <h1 style="color:sienna;margin-left:20px;">This is a paragraph.</h1>  This style will only effect this heading and if you make another, you have to type again the code.  An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!
  • 18.
  • 19. Embedded CSS  Is one that is placed within a <style> element between the <head> and the </head> tags of a document.  The style rules described in it will only affect that particular document.
  • 20. Embedded CSS <html> <head> <title>Embedded CSS Example</title> <style type=“text/css”> h2 { Font-family: Verdana, Arial, Helvetica, sans-serif; Color:#cc99cc; } </style> </head> <body> <h2> Text to be styled </h2> </body> </html>
  • 21. External Stylesheets  This style allows you to fully benefit from CSS.  To make an external stylesheet, you simply take a simple style rules and place them into a file with the extension name „.css‟ then link it to the document you want it affected.
  • 22. h2 { font-family: Verdana, Arial, Helvetica, sans-serif; color: #cc99cc; }  Save it as global.css,
  • 23. then attach it to your document by adding the follow line code between <head></head> tags of your HTML document: <html> <head> <title> External CSS Example</title> <link rel="stylesheet" type="text/css" href="global.css" /> </head> <body> <h2> Text to be styled using the external stylesheet. </h2> </body> </html>