SlideShare a Scribd company logo
1 of 2
Download to read offline
Search
Home
Web Tutorials
Beginner Tutorial
HTML Tutorial
CSS Tutorial
Scripting
Javascript Tutorial
PHP Tutorial
Perl Tutorial
Ajax Tutorial
ASP Tutorial
VBScript Tutorial
Databases
SQL Tutorial
MySQL Tutorial
Miscellaneous
XML Tutorial
Webhost Tutorial
Flash Tutorial
SEO Tutorial
CSS Tutorial
CSS - Introduction
CSS - Selector
CSS - Internal
CSS - External
CSS - Inline
CSS - Class
CSS - Background
CSS - Font
CSS - Text
CSS - Padding
CSS - Margin
CSS - Border
CSS - List
CSS - Pseudo Class &
Mouseover
Advanced Topics
CSS - Cursor
CSS - Properties
CSS - Position
CSS - Layers
CSS - Float
CSS - ID vs Class
CSS - Display
Get Help!
CSS Forum
Contact Us
cssclasses
You may be wondering if it is possible to give an HTML element multiple looks
with CSS. Say for example that sometimes you want the font to be large and white,
while other times you would prefer the font to be small and black. CSS would not be
very useful if it did not allow you to have many different types of formats for a single
HTML tag. Well, you are in luck! CSS allows you to do just that with the use of
classes.
Advertise on Tizag.com
the formatofclasses
Using classes is simple. You just need to add an extension to the typical CSS
code and make sure you specify this extension in your HTML. Let's try this with an
example of making two paragraphs that behave differently. First, we begin with the
CSS code, note the red text.
CSS Code:
HTML Code:
Display:
This is a normal paragraph.
This is a paragraph that uses the p.first CSS code!
This is a paragraph that uses the p.second CSS code!
You can use CSS classes with any HTML element! However, what happens if
we had already defined a value for the default <p> tag, would this cause any
problems for classes of the paragraph tag?
Well, when this happens the CSS class for any <p> tag will override the default
<p> CSS. If the CSS class uses a CSS attribute already defined by the default CSS,
then the formatting defined by the class will be the value that is used.
It may be easier to imagine that the CSS for a generic HTML element is the
starting point and the only way to change that look is to overwrite the attributes
using CSS classes. Please see the example below for a visual of this tricky topic.
CSS Code:
Web Reference
HTML Reference
CSS Reference
CSS Examples
PHP Examples
Help Tizag Grow
Link to Tizag
New - Tizag.com Forums!
Recent Forum Topics:
- Which Laptop(s) and Notebook
(s) could u recommend?
- Obhosting | unlimited reseller &
master reseller hosting | 20%off
- linked text
- call a function
Advertise Here
More Tutorials!
Microsoft Office Tutorials
Artist Tutorials
p.first{ color: blue; }
p.second{ color: red; }
<html>
<body>
<p>This is a normal paragraph.</p>
<p class="first">This is a paragraph that uses the p.first CSS code!</p>
<p class="second">This is a paragraph that uses the p.second CSS code!</p>
...
p{ color: red; font-size: 20px; }
p.test1{ color: blue; }
p.test2{ font-size: 12px; }
Page 1 of 2CSS Tutorial - Class
9/28/2010http://www.tizag.com/cssT/class.php
Go Back Continue
HTML Code:
Display:
This is a normal paragraph.
This is a paragraph that uses the p.test1
CSS code! The p.test1 paragraph remained
the same size, but it's color changed.
This is a paragraph that uses the p.test2 CSS code! The p.test2
paragraph remained the same color, but it's size changed.
Remember, CSS code in classes will override the general CSS code for that
element. p.test1 overrides p!
foundsomethingwronginthislesson?
Report a Bug or Comment on This Lesson - Your input is what keeps Tizag
improving with time!
Try it out!
<html>
<head>
<style>
p.first { background-color: gray; }
p.second { background-color: red; }
p.third {
background: purple;
color: white;
}
</style>
</head>
<body>
<h2>CSS Classes</h2>
<p class="first">This is the p.first paragraph</p>
<p class="second">This is the p.second paragraph</p>
<p class="third">This is the p.third paragraph</p>
Submit Query
2003-2008 Erack Network | Copyright | Privacy Policy | Advertising Information
Site design by Seattle Web Design
<html>
<body>
<p>This is a normal paragraph.</p>
<p class="test1">This is a paragraph that uses the p.test1 CSS code!</p>
<p class="test2">This is a paragraph that uses the p.test2 CSS code!</p>
...
Ads by Google CSS Web Design Free PHP Code CSS Servers MySQL Tutorial
Page 2 of 2CSS Tutorial - Class
9/28/2010http://www.tizag.com/cssT/class.php

More Related Content

What's hot

Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Hatem Mahmoud
 
Kristina benjamin fonttag
Kristina benjamin fonttagKristina benjamin fonttag
Kristina benjamin fonttagkristibenjamin
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2Jeff Byrnes
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSSRuss Weakley
 
Pemrograman Web 4 - Bootstrap 3
Pemrograman Web 4 - Bootstrap 3Pemrograman Web 4 - Bootstrap 3
Pemrograman Web 4 - Bootstrap 3Nur Fadli Utomo
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 MinutesPatrick Crowley
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to cssNeil Perlin
 
Links and Navigation
Links and NavigationLinks and Navigation
Links and Navigationsdireland
 
Css with example
Css with exampleCss with example
Css with examplereshmy12
 
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Nur Fadli Utomo
 
Visualizing The Code
Visualizing The CodeVisualizing The Code
Visualizing The Codesdireland
 
CSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorCSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorKelly Kellum
 
How to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS projectHow to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS projectRenoir Boulanger
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to csseShikshak
 

What's hot (19)

Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02
 
Kristina benjamin fonttag
Kristina benjamin fonttagKristina benjamin fonttag
Kristina benjamin fonttag
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSS
 
Inline, Block and Positioning in CSS
Inline, Block and Positioning in CSSInline, Block and Positioning in CSS
Inline, Block and Positioning in CSS
 
Pemrograman Web 2 - CSS
Pemrograman Web 2 - CSSPemrograman Web 2 - CSS
Pemrograman Web 2 - CSS
 
David Weliver
David WeliverDavid Weliver
David Weliver
 
Pemrograman Web 4 - Bootstrap 3
Pemrograman Web 4 - Bootstrap 3Pemrograman Web 4 - Bootstrap 3
Pemrograman Web 4 - Bootstrap 3
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 Minutes
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to css
 
Links and Navigation
Links and NavigationLinks and Navigation
Links and Navigation
 
Css with example
Css with exampleCss with example
Css with example
 
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2
 
Visualizing The Code
Visualizing The CodeVisualizing The Code
Visualizing The Code
 
CSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorCSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and Color
 
Html & CSS
Html & CSSHtml & CSS
Html & CSS
 
Intro to CSS
Intro to CSSIntro to CSS
Intro to CSS
 
How to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS projectHow to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS project
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 

Similar to Class

Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
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 essentialsQA TrainingHub
 
A complete html and css guidelines for beginners
A complete html and css guidelines for beginnersA complete html and css guidelines for beginners
A complete html and css guidelines for beginnersSurendra kumar
 
Css Founder.com | Cssfounder org
Css Founder.com | Cssfounder orgCss Founder.com | Cssfounder org
Css Founder.com | Cssfounder orgCss Founder
 
The CSS Handbook
The CSS HandbookThe CSS Handbook
The CSS Handbookjackchenvlo
 
CSS Basic and Common Errors
CSS Basic and Common ErrorsCSS Basic and Common Errors
CSS Basic and Common ErrorsHock Leng PUAH
 
Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesHeather Rock
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakessanjay2211
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptTusharTikia
 

Similar to Class (20)

Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
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
 
A complete html and css guidelines for beginners
A complete html and css guidelines for beginnersA complete html and css guidelines for beginners
A complete html and css guidelines for beginners
 
Css Founder.com | Cssfounder org
Css Founder.com | Cssfounder orgCss Founder.com | Cssfounder org
Css Founder.com | Cssfounder org
 
The CSS Handbook
The CSS HandbookThe CSS Handbook
The CSS Handbook
 
CSS Basic and Common Errors
CSS Basic and Common ErrorsCSS Basic and Common Errors
CSS Basic and Common Errors
 
Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 Slides
 
Css
CssCss
Css
 
Rational HATS and CSS
Rational HATS and CSSRational HATS and CSS
Rational HATS and CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.ppt
 
Le Wagon - 2h Landing
Le Wagon - 2h LandingLe Wagon - 2h Landing
Le Wagon - 2h Landing
 

More from Daniel Downs

Developing a mobile application curriculum which empowers authentic
Developing a mobile application curriculum which empowers authenticDeveloping a mobile application curriculum which empowers authentic
Developing a mobile application curriculum which empowers authenticDaniel Downs
 
Module11: Creating A External Style Sheet and Creating A Gallery
Module11: Creating A External Style Sheet and Creating A GalleryModule11: Creating A External Style Sheet and Creating A Gallery
Module11: Creating A External Style Sheet and Creating A GalleryDaniel Downs
 
Seo continued page 2
Seo continued page 2Seo continued page 2
Seo continued page 2Daniel Downs
 
Module 10search engine optimization
Module 10search engine optimizationModule 10search engine optimization
Module 10search engine optimizationDaniel Downs
 
Ipad quick-reference-2
Ipad quick-reference-2Ipad quick-reference-2
Ipad quick-reference-2Daniel Downs
 
Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.Daniel Downs
 
Jquery template 1 3 pages
Jquery template 1 3 pagesJquery template 1 3 pages
Jquery template 1 3 pagesDaniel Downs
 
Module6 htmlcss helpfulcodeandwebsites
Module6 htmlcss helpfulcodeandwebsitesModule6 htmlcss helpfulcodeandwebsites
Module6 htmlcss helpfulcodeandwebsitesDaniel Downs
 
Module 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel DownsModule 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel DownsDaniel Downs
 
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington MaModule 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington MaDaniel Downs
 
Module 2 lexington minuteman web development basic layout template
Module 2  lexington minuteman web development basic layout templateModule 2  lexington minuteman web development basic layout template
Module 2 lexington minuteman web development basic layout templateDaniel Downs
 
Module 1 Web design & Development Lexington Minuteman
Module 1 Web design & Development Lexington MinutemanModule 1 Web design & Development Lexington Minuteman
Module 1 Web design & Development Lexington MinutemanDaniel Downs
 
App research project
App research projectApp research project
App research projectDaniel Downs
 
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...Daniel Downs
 
Blogger custom domain on go daddy blogger widgets
Blogger custom domain on go daddy   blogger widgetsBlogger custom domain on go daddy   blogger widgets
Blogger custom domain on go daddy blogger widgetsDaniel Downs
 
Outline for action research prospectus
Outline for action research prospectusOutline for action research prospectus
Outline for action research prospectusDaniel Downs
 
You have decided to go off on your own as a freelance webdesigner
You have decided to go off on your own as a freelance webdesignerYou have decided to go off on your own as a freelance webdesigner
You have decided to go off on your own as a freelance webdesignerDaniel Downs
 
Making a basicappinflash (1)
Making a basicappinflash (1)Making a basicappinflash (1)
Making a basicappinflash (1)Daniel Downs
 
Daniel Downs Technology Portfolio Final May 2013 final (1)
Daniel Downs Technology Portfolio Final May 2013 final (1)Daniel Downs Technology Portfolio Final May 2013 final (1)
Daniel Downs Technology Portfolio Final May 2013 final (1)Daniel Downs
 
Web design 1& 2 lesson outline
Web design 1& 2 lesson outlineWeb design 1& 2 lesson outline
Web design 1& 2 lesson outlineDaniel Downs
 

More from Daniel Downs (20)

Developing a mobile application curriculum which empowers authentic
Developing a mobile application curriculum which empowers authenticDeveloping a mobile application curriculum which empowers authentic
Developing a mobile application curriculum which empowers authentic
 
Module11: Creating A External Style Sheet and Creating A Gallery
Module11: Creating A External Style Sheet and Creating A GalleryModule11: Creating A External Style Sheet and Creating A Gallery
Module11: Creating A External Style Sheet and Creating A Gallery
 
Seo continued page 2
Seo continued page 2Seo continued page 2
Seo continued page 2
 
Module 10search engine optimization
Module 10search engine optimizationModule 10search engine optimization
Module 10search engine optimization
 
Ipad quick-reference-2
Ipad quick-reference-2Ipad quick-reference-2
Ipad quick-reference-2
 
Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.Index of jquery template 2 Minuteman Summer Web Dev.
Index of jquery template 2 Minuteman Summer Web Dev.
 
Jquery template 1 3 pages
Jquery template 1 3 pagesJquery template 1 3 pages
Jquery template 1 3 pages
 
Module6 htmlcss helpfulcodeandwebsites
Module6 htmlcss helpfulcodeandwebsitesModule6 htmlcss helpfulcodeandwebsites
Module6 htmlcss helpfulcodeandwebsites
 
Module 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel DownsModule 4 Minuteman Lexington Web Design Daniel Downs
Module 4 Minuteman Lexington Web Design Daniel Downs
 
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington MaModule 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
Module 3 Progress Codes Web Design Daniel Downs Minuteman Lexington Ma
 
Module 2 lexington minuteman web development basic layout template
Module 2  lexington minuteman web development basic layout templateModule 2  lexington minuteman web development basic layout template
Module 2 lexington minuteman web development basic layout template
 
Module 1 Web design & Development Lexington Minuteman
Module 1 Web design & Development Lexington MinutemanModule 1 Web design & Development Lexington Minuteman
Module 1 Web design & Development Lexington Minuteman
 
App research project
App research projectApp research project
App research project
 
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
Daniel Downs: Student Experiences In A Project Based Learning Technology Curr...
 
Blogger custom domain on go daddy blogger widgets
Blogger custom domain on go daddy   blogger widgetsBlogger custom domain on go daddy   blogger widgets
Blogger custom domain on go daddy blogger widgets
 
Outline for action research prospectus
Outline for action research prospectusOutline for action research prospectus
Outline for action research prospectus
 
You have decided to go off on your own as a freelance webdesigner
You have decided to go off on your own as a freelance webdesignerYou have decided to go off on your own as a freelance webdesigner
You have decided to go off on your own as a freelance webdesigner
 
Making a basicappinflash (1)
Making a basicappinflash (1)Making a basicappinflash (1)
Making a basicappinflash (1)
 
Daniel Downs Technology Portfolio Final May 2013 final (1)
Daniel Downs Technology Portfolio Final May 2013 final (1)Daniel Downs Technology Portfolio Final May 2013 final (1)
Daniel Downs Technology Portfolio Final May 2013 final (1)
 
Web design 1& 2 lesson outline
Web design 1& 2 lesson outlineWeb design 1& 2 lesson outline
Web design 1& 2 lesson outline
 

Class

  • 1. Search Home Web Tutorials Beginner Tutorial HTML Tutorial CSS Tutorial Scripting Javascript Tutorial PHP Tutorial Perl Tutorial Ajax Tutorial ASP Tutorial VBScript Tutorial Databases SQL Tutorial MySQL Tutorial Miscellaneous XML Tutorial Webhost Tutorial Flash Tutorial SEO Tutorial CSS Tutorial CSS - Introduction CSS - Selector CSS - Internal CSS - External CSS - Inline CSS - Class CSS - Background CSS - Font CSS - Text CSS - Padding CSS - Margin CSS - Border CSS - List CSS - Pseudo Class & Mouseover Advanced Topics CSS - Cursor CSS - Properties CSS - Position CSS - Layers CSS - Float CSS - ID vs Class CSS - Display Get Help! CSS Forum Contact Us cssclasses You may be wondering if it is possible to give an HTML element multiple looks with CSS. Say for example that sometimes you want the font to be large and white, while other times you would prefer the font to be small and black. CSS would not be very useful if it did not allow you to have many different types of formats for a single HTML tag. Well, you are in luck! CSS allows you to do just that with the use of classes. Advertise on Tizag.com the formatofclasses Using classes is simple. You just need to add an extension to the typical CSS code and make sure you specify this extension in your HTML. Let's try this with an example of making two paragraphs that behave differently. First, we begin with the CSS code, note the red text. CSS Code: HTML Code: Display: This is a normal paragraph. This is a paragraph that uses the p.first CSS code! This is a paragraph that uses the p.second CSS code! You can use CSS classes with any HTML element! However, what happens if we had already defined a value for the default <p> tag, would this cause any problems for classes of the paragraph tag? Well, when this happens the CSS class for any <p> tag will override the default <p> CSS. If the CSS class uses a CSS attribute already defined by the default CSS, then the formatting defined by the class will be the value that is used. It may be easier to imagine that the CSS for a generic HTML element is the starting point and the only way to change that look is to overwrite the attributes using CSS classes. Please see the example below for a visual of this tricky topic. CSS Code: Web Reference HTML Reference CSS Reference CSS Examples PHP Examples Help Tizag Grow Link to Tizag New - Tizag.com Forums! Recent Forum Topics: - Which Laptop(s) and Notebook (s) could u recommend? - Obhosting | unlimited reseller & master reseller hosting | 20%off - linked text - call a function Advertise Here More Tutorials! Microsoft Office Tutorials Artist Tutorials p.first{ color: blue; } p.second{ color: red; } <html> <body> <p>This is a normal paragraph.</p> <p class="first">This is a paragraph that uses the p.first CSS code!</p> <p class="second">This is a paragraph that uses the p.second CSS code!</p> ... p{ color: red; font-size: 20px; } p.test1{ color: blue; } p.test2{ font-size: 12px; } Page 1 of 2CSS Tutorial - Class 9/28/2010http://www.tizag.com/cssT/class.php
  • 2. Go Back Continue HTML Code: Display: This is a normal paragraph. This is a paragraph that uses the p.test1 CSS code! The p.test1 paragraph remained the same size, but it's color changed. This is a paragraph that uses the p.test2 CSS code! The p.test2 paragraph remained the same color, but it's size changed. Remember, CSS code in classes will override the general CSS code for that element. p.test1 overrides p! foundsomethingwronginthislesson? Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time! Try it out! <html> <head> <style> p.first { background-color: gray; } p.second { background-color: red; } p.third { background: purple; color: white; } </style> </head> <body> <h2>CSS Classes</h2> <p class="first">This is the p.first paragraph</p> <p class="second">This is the p.second paragraph</p> <p class="third">This is the p.third paragraph</p> Submit Query 2003-2008 Erack Network | Copyright | Privacy Policy | Advertising Information Site design by Seattle Web Design <html> <body> <p>This is a normal paragraph.</p> <p class="test1">This is a paragraph that uses the p.test1 CSS code!</p> <p class="test2">This is a paragraph that uses the p.test2 CSS code!</p> ... Ads by Google CSS Web Design Free PHP Code CSS Servers MySQL Tutorial Page 2 of 2CSS Tutorial - Class 9/28/2010http://www.tizag.com/cssT/class.php