SlideShare une entreprise Scribd logo
1  sur  17
css the very basics ,[object Object],kenny tang jan 2010
Before HTML4, styles were done with <font>, <br>, &nbsp;, <table> tags:
CSS came along with the aim of removing formatting from HTML documents markup with inline style browser rendering
CSS rules syntax HTML element you want to style property:value pairs (same line or multiple)
Choosing the correct selector: which element(s) do you want to style? One single line of text? A block of YSM ads? All content wrapped with <p> tags? The page background? Use  id ,  class  and  tag  for differentiation
id - targets a  single, unique  element: use  #  in css selector  use  id  in html tag
class - targets  multiple  elements: use  ‘.’  in css selector  use  class  in html tag targets all elements with class “ yschysm ” with html tag “ li ”
tags - targets specific html elements: use  html tag name  in css selector  no special tags needed in html tag targets all elements with tag “ a ” with state of “link” (static hyperlinks) commonly used for removing underlines from <a> tags
recap of selector declarations so far: class: id: tags: finer-grain targeting: targets all  <a>  links in hover state, which are enclosed by  <li>  tags, with  class  of “ vsearchtabs ” and  id  of “ searchtab_t ”
styles possessed by each element are inherited from multiple sources it’s up to css parsers and rendering engines (webkit, gecko) to analyze the style hierarchy and decide how to render each and every element #heading1{text-align:center;color:red;}  external .css file <head> <style> #heading1{text-align:left;color:green;}  </style> </head> internal <style> block inline style browser rendering result:
Quick scan of fundamental css attributes: top,right,bottom,left
css browser hacks, sometimes needed for those IE quirks
Simple FE bugs troubleshooting tips:  1. With Firebug’s inspect tool, understand the  basic structure  of the page first.
Simple FE bugs troubleshooting tips:  2. Drill down the DOM tree to locate the area/element you wish to check: “ fcts_lp ”: left rail “ r-m ”: main search results area
Simple FE bugs troubleshooting tips:  3. With Firebug’s inspect tools, identify the element and look at the style info on the right pane.
Simple FE bugs troubleshooting tips:  4. Attempt to troubleshoot/fix the problem by inserting style attributes directly into the style pane and observe what happens:
Required Reading links removed

Contenu connexe

Tendances

Meta Tag Presentation
Meta Tag PresentationMeta Tag Presentation
Meta Tag Presentation
laurlaur123
 
Frederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentationFrederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentation
highbaughjr
 
Meta tags
Meta tagsMeta tags
Meta tags
hapy
 

Tendances (20)

Higher Computing Science HTML
Higher Computing Science HTMLHigher Computing Science HTML
Higher Computing Science HTML
 
Meta Tag Presentation
Meta Tag PresentationMeta Tag Presentation
Meta Tag Presentation
 
The html tag
The html tagThe html tag
The html tag
 
Design Dream
Design DreamDesign Dream
Design Dream
 
Computer fundamentals-internet p2
Computer fundamentals-internet p2Computer fundamentals-internet p2
Computer fundamentals-internet p2
 
Frederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentationFrederick Highbaugh Jr Art 2830 Meta tag presentation
Frederick Highbaugh Jr Art 2830 Meta tag presentation
 
Introduction to web development - HTML 5
Introduction to web development - HTML 5Introduction to web development - HTML 5
Introduction to web development - HTML 5
 
10x10 slides
10x10 slides10x10 slides
10x10 slides
 
Higher Computing Science CSS
Higher Computing Science CSSHigher Computing Science CSS
Higher Computing Science CSS
 
Web Page Designing
Web Page DesigningWeb Page Designing
Web Page Designing
 
Web Development - Lecture 2
Web Development - Lecture 2Web Development - Lecture 2
Web Development - Lecture 2
 
Seas the day our top 5 features you might not know
Seas the day our top 5 features you might not knowSeas the day our top 5 features you might not know
Seas the day our top 5 features you might not know
 
Web Development - Lecture 3
Web Development - Lecture 3Web Development - Lecture 3
Web Development - Lecture 3
 
Presentation html
Presentation   htmlPresentation   html
Presentation html
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
Basic html structure
Basic html structureBasic html structure
Basic html structure
 
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJSBasic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
 
Css intro
Css introCss intro
Css intro
 
Class13
Class13Class13
Class13
 
Meta tags
Meta tagsMeta tags
Meta tags
 

En vedette (7)

Curr opin hiv blips 2006
Curr opin hiv blips 2006Curr opin hiv blips 2006
Curr opin hiv blips 2006
 
Natur net ieia_presentation_bg
Natur net ieia_presentation_bgNatur net ieia_presentation_bg
Natur net ieia_presentation_bg
 
Apertureshutterspeed
ApertureshutterspeedApertureshutterspeed
Apertureshutterspeed
 
Googlewave
GooglewaveGooglewave
Googlewave
 
Googlewave
GooglewaveGooglewave
Googlewave
 
My Daily Commute Sf Bay May July 10
My Daily Commute Sf Bay May July 10My Daily Commute Sf Bay May July 10
My Daily Commute Sf Bay May July 10
 
sweet babies, aranyos babák, süsse babys
sweet babies, aranyos babák, süsse babyssweet babies, aranyos babák, süsse babys
sweet babies, aranyos babák, süsse babys
 

Similaire à Css Primer - basic stuff

Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Marc Steel
 
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
sanjay2211
 
Css introduction
Css introductionCss introduction
Css introduction
Sridhar P
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
butest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
butest
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Erin M. Kidwell
 

Similaire à Css Primer - basic stuff (20)

Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 
CSS
CSSCSS
CSS
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
 
Html & Html5 from scratch
Html & Html5 from scratchHtml & Html5 from scratch
Html & Html5 from scratch
 
Casc Style Sheets Ii
Casc Style Sheets IiCasc Style Sheets Ii
Casc Style Sheets Ii
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Web 101
Web 101Web 101
Web 101
 
HTML & CSS Workshop Notes
HTML & CSS Workshop NotesHTML & CSS Workshop Notes
HTML & CSS Workshop Notes
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
 
Workshop 2 Slides.pptx
Workshop 2 Slides.pptxWorkshop 2 Slides.pptx
Workshop 2 Slides.pptx
 
Basic css
Basic cssBasic css
Basic css
 
Html, CSS & Web Designing
Html, CSS & Web DesigningHtml, CSS & Web Designing
Html, CSS & Web Designing
 
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 Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
 
Css introduction
Css introductionCss introduction
Css introduction
 
Advanced Cascading Style Sheets
Advanced Cascading Style SheetsAdvanced Cascading Style Sheets
Advanced Cascading Style Sheets
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
 

Plus de kenshin03

Plus de kenshin03 (8)

Apple inc and Steve Jobs - a bit of history
Apple inc and Steve Jobs - a bit of historyApple inc and Steve Jobs - a bit of history
Apple inc and Steve Jobs - a bit of history
 
Visualizing the Search Tail
Visualizing the Search TailVisualizing the Search Tail
Visualizing the Search Tail
 
Good presentation styles
Good presentation stylesGood presentation styles
Good presentation styles
 
Iphone os dev sharing with new examples
Iphone os dev sharing with new examplesIphone os dev sharing with new examples
Iphone os dev sharing with new examples
 
Search Monkey Overview
Search Monkey OverviewSearch Monkey Overview
Search Monkey Overview
 
Yahoo! Search Monkey in 3 slides
Yahoo! Search Monkey in 3 slidesYahoo! Search Monkey in 3 slides
Yahoo! Search Monkey in 3 slides
 
Geo search introduction
Geo search introductionGeo search introduction
Geo search introduction
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basics
 

Dernier

Dernier (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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
 
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
 
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...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Css Primer - basic stuff

  • 1.
  • 2. Before HTML4, styles were done with <font>, <br>, &nbsp;, <table> tags:
  • 3. CSS came along with the aim of removing formatting from HTML documents markup with inline style browser rendering
  • 4. CSS rules syntax HTML element you want to style property:value pairs (same line or multiple)
  • 5. Choosing the correct selector: which element(s) do you want to style? One single line of text? A block of YSM ads? All content wrapped with <p> tags? The page background? Use id , class and tag for differentiation
  • 6. id - targets a single, unique element: use # in css selector use id in html tag
  • 7. class - targets multiple elements: use ‘.’ in css selector use class in html tag targets all elements with class “ yschysm ” with html tag “ li ”
  • 8. tags - targets specific html elements: use html tag name in css selector no special tags needed in html tag targets all elements with tag “ a ” with state of “link” (static hyperlinks) commonly used for removing underlines from <a> tags
  • 9. recap of selector declarations so far: class: id: tags: finer-grain targeting: targets all <a> links in hover state, which are enclosed by <li> tags, with class of “ vsearchtabs ” and id of “ searchtab_t ”
  • 10. styles possessed by each element are inherited from multiple sources it’s up to css parsers and rendering engines (webkit, gecko) to analyze the style hierarchy and decide how to render each and every element #heading1{text-align:center;color:red;} external .css file <head> <style> #heading1{text-align:left;color:green;} </style> </head> internal <style> block inline style browser rendering result:
  • 11. Quick scan of fundamental css attributes: top,right,bottom,left
  • 12. css browser hacks, sometimes needed for those IE quirks
  • 13. Simple FE bugs troubleshooting tips: 1. With Firebug’s inspect tool, understand the basic structure of the page first.
  • 14. Simple FE bugs troubleshooting tips: 2. Drill down the DOM tree to locate the area/element you wish to check: “ fcts_lp ”: left rail “ r-m ”: main search results area
  • 15. Simple FE bugs troubleshooting tips: 3. With Firebug’s inspect tools, identify the element and look at the style info on the right pane.
  • 16. Simple FE bugs troubleshooting tips: 4. Attempt to troubleshoot/fix the problem by inserting style attributes directly into the style pane and observe what happens: