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

PDF
Inline, Block and Positioning in CSS
PPTX
Web 102 INtro to CSS
PDF
Intro to CSS
PDF
Intro to HTML + CSS
PDF
Links and Navigation
ODP
Cascading Style Sheets - Part 02
PDF
Responsive Web Design (April 18th, Los Angeles)
PDF
Inline, Block and Positioning in CSS
Web 102 INtro to CSS
Intro to CSS
Intro to HTML + CSS
Links and Navigation
Cascading Style Sheets - Part 02
Responsive Web Design (April 18th, Los Angeles)

What's hot (19)

PDF
Visualizing The Code
PDF
Shaping Up With CSS
PDF
4. Web Technology CSS Basics-1
KEY
Sass: The Future of Stylesheets
PPTX
Design for Developers: Introduction to Bootstrap 3
PDF
CSS Best practice
PDF
Pemrograman Web 4 - Bootstrap 3
PDF
Haml And Sass In 15 Minutes
PDF
Thinkful - Frontend Crash Course - Intro to HTML/CSS
PDF
HTML+CSS: how to get started
PDF
Intro to css & sass
PDF
Intro to html, css & sass
PPT
CSS Introduction
PDF
Html:css crash course (4:5)
PDF
Efficient, maintainable CSS
PPTX
Kick start @ css
PDF
Le Wagon - Build your Landing Page in 2 hours
PDF
Html css crash course may 11th, atlanta
Visualizing The Code
Shaping Up With CSS
4. Web Technology CSS Basics-1
Sass: The Future of Stylesheets
Design for Developers: Introduction to Bootstrap 3
CSS Best practice
Pemrograman Web 4 - Bootstrap 3
Haml And Sass In 15 Minutes
Thinkful - Frontend Crash Course - Intro to HTML/CSS
HTML+CSS: how to get started
Intro to css & sass
Intro to html, css & sass
CSS Introduction
Html:css crash course (4:5)
Efficient, maintainable CSS
Kick start @ css
Le Wagon - Build your Landing Page in 2 hours
Html css crash course may 11th, atlanta
Ad

Viewers also liked (9)

ODP
JavaScript and jQuery Fundamentals
PDF
Less & RequireJS - Frontend Development in Magento 2
PDF
Magento 2 performance - a benchmark
PDF
Front End Development in Magento
PDF
How to create theme in Magento 2 - Part 2
KEY
HTML CSS & Javascript
PPTX
Madison PHP - Getting Started with Magento 2
PDF
How To Create Theme in Magento 2 - Part 1
PDF
Html / CSS Presentation
JavaScript and jQuery Fundamentals
Less & RequireJS - Frontend Development in Magento 2
Magento 2 performance - a benchmark
Front End Development in Magento
How to create theme in Magento 2 - Part 2
HTML CSS & Javascript
Madison PHP - Getting Started with Magento 2
How To Create Theme in Magento 2 - Part 1
Html / CSS Presentation
Ad

Similar to CSS Fundamentals (20)

PPT
CSS Part I
ODP
Cascading Style Sheets - Part 01
PPTX
PPTX
PPTX
uptu web technology unit 2 Css
PDF
Intro to HTML and CSS - Class 2 Slides
PPT
PPT
AK css
PPT
PPT
Chapter 3 - Web Design
PPT
cascading style sheet ppt
PPT
Cascading Style Sheets
PPTX
CSS Basics (Cascading Style Sheet)
PPT
CSS Part I
Cascading Style Sheets - Part 01
uptu web technology unit 2 Css
Intro to HTML and CSS - Class 2 Slides
AK css
Chapter 3 - Web Design
cascading style sheet ppt
Cascading Style Sheets
CSS Basics (Cascading Style Sheet)

More from Ray Villalobos (9)

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

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Machine learning based COVID-19 study performance prediction
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
MYSQL Presentation for SQL database connectivity
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Spectroscopy.pptx food analysis technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation_ Review paper, used for researhc scholars
Machine learning based COVID-19 study performance prediction
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

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)