SlideShare ist ein Scribd-Unternehmen logo
1 von 22
CSSCascading Style Sheets Md. Shajed E Islam
What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements External Style Sheets can save a lot of work External Style Sheets are stored in CSS files
Benefits of Using CSS
Separate content from Fast loading pages Small file size Save time Save money Flexibility of design. Way of the future Print friendly
CSS Syntax A CSS rule has two main parts: a selector, and one or more declarations:
CSS Example p{color:red;text-align:center;} P {color:red; text-align:center; } /*This is a comment*/
CSS Id and Class
#para1{ text-align:center; color:red;} .center {text-align:center;}p.center {text-align:center;}   Example id/class <p id=“center”></p> <p class=“center”></p> Do NOT start an ID name with a number! It will not work in Mozilla/Firefox. Do NOT start a class name with a number! This is only supported in Internet Explorer.
Three Ways to Insert CSS External style sheet<head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head> Internal style sheet<head><style type="text/css">body {background-image:url("images/bg.gif");}</style></head> Inline Styles <p style="color:#000; margin-left:20px;">This is a paragraph.</p>
CSS properties
Margin Vs Padding - CSS Properties
Grouping and Nesting Selectors h1,h2,p{color:green;} .marked p{color:white;}
CSS Display and Visibility div.login {visibility:hidden;} div.login {display:none;} display:none means that the the tag in question will not appear on the page at all (although you can still interact with it through the dom). There will be no space allocated for it. Visibility:hidden means the tag is not visible, but space is allocated for it.
CSS Positioning
CSS Float
CSS z-index
CSS Image Opacity <imgsrc=“logo.jpg" width="150" height="113" alt=“bglobal"style="opacity:0.4;filter:alpha(opacity=40)" />
Pseudo-classes a:link {color:#FF0000;}      /* unvisited link */a:visited {color:#00FF00;}  /* visited link */a:hover {color:#FF00FF;}  /* mouse over link */a:active {color:#0000FF;}  /* selected link */
CSS Navigation Bar <style type="text/css"> ul{ list-style-type:none; margin:0; padding:0; overflow:hidden;} li{ float:left;} a:link,a:visited{ display:block; width:120px; font-weight:bold; color:#FFFFFF; background-color:#98bf21; text-align:center; padding:4px; text-decoration:none; text-transform:uppercase; } a:hover,a:active { background-color:#7A991A; } </style>
<ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">News</a></li> <li><a href="#">Contact</a></li> </ul>
Reference http://www.w3schools.com/css
Thanks

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Css introduction
Css   introductionCss   introduction
Css introduction
 
Html and css
Html and cssHtml and css
Html and css
 
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
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Unit iii css and javascript 1
Unit iii css and javascript 1Unit iii css and javascript 1
Unit iii css and javascript 1
 
Css intro
Css introCss intro
Css intro
 
Html css
Html cssHtml css
Html css
 
Css
CssCss
Css
 
Cascstylesheets
CascstylesheetsCascstylesheets
Cascstylesheets
 
Coding a Website with HTML
Coding a Website with HTMLCoding a Website with HTML
Coding a Website with HTML
 
Css Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder.com | Cssfounder se
Css Founder.com | Cssfounder se
 
Basic HTML/CSS
Basic HTML/CSSBasic HTML/CSS
Basic HTML/CSS
 
css
csscss
css
 
Css inclusion
Css   inclusionCss   inclusion
Css inclusion
 
Week3 css
Week3 cssWeek3 css
Week3 css
 
Boostrap basics
Boostrap basicsBoostrap basics
Boostrap basics
 
Css introduction
Css introductionCss introduction
Css introduction
 
Turorial css
Turorial cssTurorial css
Turorial css
 
Introduction of css
Introduction of cssIntroduction of css
Introduction of css
 
Css module1
Css module1Css module1
Css module1
 

Andere mochten auch

Andere mochten auch (13)

Css advance
Css   advanceCss   advance
Css advance
 
Basic css-tutorial
Basic css-tutorialBasic css-tutorial
Basic css-tutorial
 
CSS - Basics
CSS - BasicsCSS - Basics
CSS - Basics
 
CSS Tutorial
CSS TutorialCSS Tutorial
CSS Tutorial
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
The Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsThe Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and Friends
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 

Ähnlich wie CSS tutorial

LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
Amanda Case
 

Ähnlich wie CSS tutorial (20)

Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.ppt
 
Css Basics
Css BasicsCss Basics
Css Basics
 
Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
 
Shyam sunder Rajasthan Computer
Shyam sunder Rajasthan ComputerShyam sunder Rajasthan Computer
Shyam sunder Rajasthan Computer
 
Css
CssCss
Css
 
Rational HATS and CSS
Rational HATS and CSSRational HATS and CSS
Rational HATS and CSS
 
Html html html html html html html html html
Html html html html html html html html htmlHtml html html html html html html html html
Html html html html html html html html html
 
Css ms megha
Css ms meghaCss ms megha
Css ms megha
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
Css
CssCss
Css
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
Introduction to CSS in HTML.ppt
Introduction to CSS in HTML.pptIntroduction to CSS in HTML.ppt
Introduction to CSS in HTML.ppt
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

CSS tutorial

  • 1. CSSCascading Style Sheets Md. Shajed E Islam
  • 2. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements External Style Sheets can save a lot of work External Style Sheets are stored in CSS files
  • 4. Separate content from Fast loading pages Small file size Save time Save money Flexibility of design. Way of the future Print friendly
  • 5. CSS Syntax A CSS rule has two main parts: a selector, and one or more declarations:
  • 6. CSS Example p{color:red;text-align:center;} P {color:red; text-align:center; } /*This is a comment*/
  • 7. CSS Id and Class
  • 8. #para1{ text-align:center; color:red;} .center {text-align:center;}p.center {text-align:center;} Example id/class <p id=“center”></p> <p class=“center”></p> Do NOT start an ID name with a number! It will not work in Mozilla/Firefox. Do NOT start a class name with a number! This is only supported in Internet Explorer.
  • 9. Three Ways to Insert CSS External style sheet<head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head> Internal style sheet<head><style type="text/css">body {background-image:url("images/bg.gif");}</style></head> Inline Styles <p style="color:#000; margin-left:20px;">This is a paragraph.</p>
  • 11. Margin Vs Padding - CSS Properties
  • 12. Grouping and Nesting Selectors h1,h2,p{color:green;} .marked p{color:white;}
  • 13. CSS Display and Visibility div.login {visibility:hidden;} div.login {display:none;} display:none means that the the tag in question will not appear on the page at all (although you can still interact with it through the dom). There will be no space allocated for it. Visibility:hidden means the tag is not visible, but space is allocated for it.
  • 17. CSS Image Opacity <imgsrc=“logo.jpg" width="150" height="113" alt=“bglobal"style="opacity:0.4;filter:alpha(opacity=40)" />
  • 18. Pseudo-classes a:link {color:#FF0000;}      /* unvisited link */a:visited {color:#00FF00;}  /* visited link */a:hover {color:#FF00FF;}  /* mouse over link */a:active {color:#0000FF;}  /* selected link */
  • 19. CSS Navigation Bar <style type="text/css"> ul{ list-style-type:none; margin:0; padding:0; overflow:hidden;} li{ float:left;} a:link,a:visited{ display:block; width:120px; font-weight:bold; color:#FFFFFF; background-color:#98bf21; text-align:center; padding:4px; text-decoration:none; text-transform:uppercase; } a:hover,a:active { background-color:#7A991A; } </style>
  • 20. <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">News</a></li> <li><a href="#">Contact</a></li> </ul>