SlideShare a Scribd company logo
CSS Fundamentals
What is CSS? Cascading Style Sheets Rules that define how HTML elements should look body {background:black;} Cascades part determines the order the rules are applied in
Types of Style Sheets Browser -Applies some styles by default User -Some browsers allow you to create your own styles. Author -Websites can also have style sheets...these are the ones you'll be doing.
selectors select elements to be styled declaration tells browser how to style property is what you want to modify value is the option you want for the property What does it look like? <style> em { color:red; font-weight:bold; } </style> declaration selector property value
Where does CSS go Inline  style=&quot;&quot; attribute - Only good for one tag Embedded  <style> - Good for the whole page External  <link rel=&quot;stylesheet&quot; href=&quot;&quot; /> - Many Pages
When you need to share code Only affects a specific tag Inline <em style=&quot;color:red;&quot;>dog</em>
Uses the <style> tag Affects the current page Uses selectors to specify which tags to affect Embedded <style>   em { color: green; font-size:18px;} </style>
Can affect a multitude of documents Uses a separate file that must be linked to The CSS file does NOT need <STYLE> tag External <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;my.css&quot; />
HTML Color Modes Can use Color Names like Black, Red, Blue Can use Red, Green and Blue values from Photoshop To be more specific, use Hexadecimal codes #FFCC00 Can be shortened to three letters if they're the same #FC0 Newer browsers can use rgba(0,0,0,0.5);
Children inherit styles from parent BODY is the big daddy Inheritance body { font-family:verdana; } p { font-size:10px;}
SPECIFICITY Which rules take over when there's more than one  Browsers always deal with multiple style sheets Browser/User/Author style sheet/External/embedded/inline If two rules conflict, generally the later rule wins <style>em { color: red; }</style> <p>The quick <em style=&quot;color:green;&quot;>fox</em>.</p>
Common Selectors Type Selectors:  em {color: blue; } Class Selectors:  .wrapper {background-color: #CFC;} ID Selectors:  #content {width:960px;} Descendant Selectors:  p em {color:red;}
Advanced Selectors Child Selectors:  div>em {color:red;} Universal Selector:  * {color:red;} Adjacent Sibling:  h1+h3 {color:red;} Attribute Selectors:  a[href=&quot;&quot;],img[alt] {color:red;}
Clean HTML is Crucial DOM (Document Object Model)  The Order of Things
Pseudo Elements Pseudo Classes:  :hover,:first-child Pseudo Elements:  :first-line, :first-letter Insertion Elements:  :before, :after
Multiple Class Selectors You can combine multiple classes by separating them by spaces &quot;wrapper mod&quot;
Class Shortcuts Font Background Border
The generic Tags Span-Inline DIV-Block Level
The Box Model Inline vs Block Margin Border Padding
Floating To the Right or to the Left The container problem Fixing it with the mod class in html5reset
Positioning Static-Normal positioning of objects Fixed-Fixed to the browser window Relative-Relative to it's current position, but can be moved Absolute-Relative to the last relatively positioned object, if one is not present, then works like Fixed...relative to the window. Z-index
The End

More Related Content

What's hot (19)

PDF
Visualizing The Code
sdireland
 
PDF
Shaping Up With CSS
sdireland
 
PDF
4. Web Technology CSS Basics-1
Jyoti Yadav
 
KEY
Sass: The Future of Stylesheets
chriseppstein
 
PPTX
Design for Developers: Introduction to Bootstrap 3
John Bertucci
 
PDF
CSS Best practice
Russ Weakley
 
PDF
Pemrograman Web 4 - Bootstrap 3
Nur Fadli Utomo
 
PDF
Haml And Sass In 15 Minutes
Patrick Crowley
 
PDF
Thinkful - Frontend Crash Course - Intro to HTML/CSS
TJ Stalcup
 
PDF
HTML+CSS: how to get started
Dimitris Tsironis
 
PDF
Intro to css & sass
Sean Wolfe
 
PDF
Intro to html, css & sass
Sean Wolfe
 
PPT
CSS Introduction
Swati Sharma
 
PDF
Html:css crash course (4:5)
Thinkful
 
PDF
Efficient, maintainable CSS
Russ Weakley
 
PPTX
Kick start @ css
Umesh Agarwal
 
PDF
Le Wagon - Build your Landing Page in 2 hours
Sandrine Ayral
 
PDF
Html css crash course may 11th, atlanta
Thinkful
 
Visualizing The Code
sdireland
 
Shaping Up With CSS
sdireland
 
4. Web Technology CSS Basics-1
Jyoti Yadav
 
Sass: The Future of Stylesheets
chriseppstein
 
Design for Developers: Introduction to Bootstrap 3
John Bertucci
 
CSS Best practice
Russ Weakley
 
Pemrograman Web 4 - Bootstrap 3
Nur Fadli Utomo
 
Haml And Sass In 15 Minutes
Patrick Crowley
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
TJ Stalcup
 
HTML+CSS: how to get started
Dimitris Tsironis
 
Intro to css & sass
Sean Wolfe
 
Intro to html, css & sass
Sean Wolfe
 
CSS Introduction
Swati Sharma
 
Html:css crash course (4:5)
Thinkful
 
Efficient, maintainable CSS
Russ Weakley
 
Kick start @ css
Umesh Agarwal
 
Le Wagon - Build your Landing Page in 2 hours
Sandrine Ayral
 
Html css crash course may 11th, atlanta
Thinkful
 

Viewers also liked (9)

ODP
JavaScript and jQuery Fundamentals
BG Java EE Course
 
PDF
Less & RequireJS - Frontend Development in Magento 2
Arjen Miedema
 
PDF
Magento 2 performance - a benchmark
Byte
 
PDF
Front End Development in Magento
Eric Landmann
 
PDF
How to create theme in Magento 2 - Part 2
Magestore
 
KEY
HTML CSS & Javascript
David Lindkvist
 
PPTX
Madison PHP - Getting Started with Magento 2
Mathew Beane
 
PDF
How To Create Theme in Magento 2 - Part 1
Magestore
 
PDF
Html / CSS Presentation
Shawn Calvert
 
JavaScript and jQuery Fundamentals
BG Java EE Course
 
Less & RequireJS - Frontend Development in Magento 2
Arjen Miedema
 
Magento 2 performance - a benchmark
Byte
 
Front End Development in Magento
Eric Landmann
 
How to create theme in Magento 2 - Part 2
Magestore
 
HTML CSS & Javascript
David Lindkvist
 
Madison PHP - Getting Started with Magento 2
Mathew Beane
 
How To Create Theme in Magento 2 - Part 1
Magestore
 
Html / CSS Presentation
Shawn Calvert
 
Ad

Similar to CSS Fundamentals (20)

PPT
How do speed up web pages? CSS & HTML Tricks
Compare Infobase Limited
 
PPT
cascading style sheet ppt
abhilashagupta
 
PPT
Basics Of Css And Some Common Mistakes
sanjay2211
 
PPT
Rational HATS and CSS
Strongback Consulting
 
PPT
Even faster web sites presentation 3
Felipe Lavín
 
PPT
CSS 101
dunclair
 
PPT
Advanced Cascading Style Sheets
fantasticdigitaltools
 
PPTX
Css intro
Andz Bass
 
PPT
CSS Methodology
Zohar Arad
 
ODP
Cascading Style Sheets - Part 01
Hatem Mahmoud
 
PPTX
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
VikasTuwar1
 
PPT
Advance Css
vijayta
 
PPT
Advance Css 1194323118268797 5
dharshyamal
 
PPT
Using a CSS Framework
Gareth Saunders
 
PDF
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Patrick Lauke
 
PPT
Html Expression Web
Mark Frydenberg
 
PPT
Css
NIRMAL FELIX
 
How do speed up web pages? CSS & HTML Tricks
Compare Infobase Limited
 
cascading style sheet ppt
abhilashagupta
 
Basics Of Css And Some Common Mistakes
sanjay2211
 
Rational HATS and CSS
Strongback Consulting
 
Even faster web sites presentation 3
Felipe Lavín
 
CSS 101
dunclair
 
Advanced Cascading Style Sheets
fantasticdigitaltools
 
Css intro
Andz Bass
 
CSS Methodology
Zohar Arad
 
Cascading Style Sheets - Part 01
Hatem Mahmoud
 
Unitegergergegegegetgegegegegegeg-2-CSS.pptx
VikasTuwar1
 
Advance Css
vijayta
 
Advance Css 1194323118268797 5
dharshyamal
 
Using a CSS Framework
Gareth Saunders
 
Styling Your Web Pages with Cascading Style Sheets / EDU course / University ...
Patrick Lauke
 
Html Expression Web
Mark Frydenberg
 
Ad

More from Ray Villalobos (9)

KEY
Making money with Google's Adsense
Ray Villalobos
 
KEY
Creating forms
Ray Villalobos
 
KEY
Doing business
Ray Villalobos
 
KEY
Analytics essentials
Ray Villalobos
 
KEY
Online Advertising
Ray Villalobos
 
KEY
Social media fundamentals
Ray Villalobos
 
KEY
Building Semantic HTML tables
Ray Villalobos
 
KEY
Working with HTML Lists
Ray Villalobos
 
PPT
Understanding html
Ray Villalobos
 
Making money with Google's Adsense
Ray Villalobos
 
Creating forms
Ray Villalobos
 
Doing business
Ray Villalobos
 
Analytics essentials
Ray Villalobos
 
Online Advertising
Ray Villalobos
 
Social media fundamentals
Ray Villalobos
 
Building Semantic HTML tables
Ray Villalobos
 
Working with HTML Lists
Ray Villalobos
 
Understanding html
Ray Villalobos
 

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Python basic programing language for automation
DanialHabibi2
 
July Patch Tuesday
Ivanti
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 

CSS Fundamentals

  • 2. What is CSS? Cascading Style Sheets Rules that define how HTML elements should look body {background:black;} Cascades part determines the order the rules are applied in
  • 3. Types of Style Sheets Browser -Applies some styles by default User -Some browsers allow you to create your own styles. Author -Websites can also have style sheets...these are the ones you'll be doing.
  • 4. selectors select elements to be styled declaration tells browser how to style property is what you want to modify value is the option you want for the property What does it look like? <style> em { color:red; font-weight:bold; } </style> declaration selector property value
  • 5. Where does CSS go Inline style=&quot;&quot; attribute - Only good for one tag Embedded <style> - Good for the whole page External <link rel=&quot;stylesheet&quot; href=&quot;&quot; /> - Many Pages
  • 6. When you need to share code Only affects a specific tag Inline <em style=&quot;color:red;&quot;>dog</em>
  • 7. Uses the <style> tag Affects the current page Uses selectors to specify which tags to affect Embedded <style> em { color: green; font-size:18px;} </style>
  • 8. Can affect a multitude of documents Uses a separate file that must be linked to The CSS file does NOT need <STYLE> tag External <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;my.css&quot; />
  • 9. HTML Color Modes Can use Color Names like Black, Red, Blue Can use Red, Green and Blue values from Photoshop To be more specific, use Hexadecimal codes #FFCC00 Can be shortened to three letters if they're the same #FC0 Newer browsers can use rgba(0,0,0,0.5);
  • 10. Children inherit styles from parent BODY is the big daddy Inheritance body { font-family:verdana; } p { font-size:10px;}
  • 11. SPECIFICITY Which rules take over when there's more than one Browsers always deal with multiple style sheets Browser/User/Author style sheet/External/embedded/inline If two rules conflict, generally the later rule wins <style>em { color: red; }</style> <p>The quick <em style=&quot;color:green;&quot;>fox</em>.</p>
  • 12. Common Selectors Type Selectors: em {color: blue; } Class Selectors: .wrapper {background-color: #CFC;} ID Selectors: #content {width:960px;} Descendant Selectors: p em {color:red;}
  • 13. Advanced Selectors Child Selectors: div>em {color:red;} Universal Selector: * {color:red;} Adjacent Sibling: h1+h3 {color:red;} Attribute Selectors: a[href=&quot;&quot;],img[alt] {color:red;}
  • 14. Clean HTML is Crucial DOM (Document Object Model) The Order of Things
  • 15. Pseudo Elements Pseudo Classes: :hover,:first-child Pseudo Elements: :first-line, :first-letter Insertion Elements: :before, :after
  • 16. Multiple Class Selectors You can combine multiple classes by separating them by spaces &quot;wrapper mod&quot;
  • 17. Class Shortcuts Font Background Border
  • 18. The generic Tags Span-Inline DIV-Block Level
  • 19. The Box Model Inline vs Block Margin Border Padding
  • 20. Floating To the Right or to the Left The container problem Fixing it with the mod class in html5reset
  • 21. Positioning Static-Normal positioning of objects Fixed-Fixed to the browser window Relative-Relative to it's current position, but can be moved Absolute-Relative to the last relatively positioned object, if one is not present, then works like Fixed...relative to the window. Z-index

Editor's Notes

  • #9: The link tag establishes relationships between the current document and other documents. It is almost always used to specify external style sheets. The rel attribute defines the type of relationship. The type attribute specifies the MIME type (the format of the text file) and the href attribute, the location of the file.
  • #11: DOM (Document Object Model)