SlideShare a Scribd company logo
1 of 27
CSS Architecture Standards and Best Practices
“CSS starts out being a pain for everyone. Don't worry. You're not stupid, CSS is.” - John Manoogian
Reasons for this  Common issues throughout the sites Knowledge sharing Advice on overcoming problems
Multiple CSS files create confusionPeterson’s homepage
Combine CSS files	 One master CSS file for common elements  One project level CSS file for project specific styles  One CSS file for print specific Other CSS filesOne CSS file for each cobrandOne CSS file for IE specific styles
Inline Styles and Internal Stylesheets
Inline Styles and Internal Stylesheets
HTML Structure
Naming Conventions Be consistent name your elements what they are, not what they do (semantic vs. presentational)
Hacks
Hacks THIS DOESN’T WORK!
Hacks
Hacks Can I code it in a way that doesn’t require any specific targeting in the first place? Can I instead use a conditional comment?
Tables aren’t the enemyThere are many places where using tables is entirely appropriate
Tables aren’t the enemy
Tables have their place, but not for layout
Main Navigation HTML (yes, that’s all there is to it!)
Main Navigation CSSThe heavy lifting
Selectors You don’t need to add a class to every element
Selectors
Selectors
Don’t Repeat Yourself Combine styles where possible
Don’t Repeat Yourself Use shorthand wherever possible
Commenting Color/Layout glossary Flag different sections
Validation Not just for HTML, but for CSS too Ensures your code is error free and interpreted in the right way for browsers Search engines
Floats Wrapping content around an element Horizontally, not vertically To stop content from wrapping, you must clear the float
DON’T PANIC

More Related Content

What's hot

Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksAndolasoft Inc
 
Object oriented css graeme blackwood
Object oriented css graeme blackwoodObject oriented css graeme blackwood
Object oriented css graeme blackwooddrupalconf
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practicessachin9737
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Campcanarymason
 
Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010canarymason
 
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStartIntro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStartScott DeLoach
 
Designing & Developing for Content in WordPress
Designing & Developing for Content in WordPressDesigning & Developing for Content in WordPress
Designing & Developing for Content in WordPressdiane_kinney
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphiacanarymason
 
Drupaldelphia Shortcuts Cheats And Cheap Stunts
Drupaldelphia  Shortcuts Cheats And Cheap StuntsDrupaldelphia  Shortcuts Cheats And Cheap Stunts
Drupaldelphia Shortcuts Cheats And Cheap Stuntscanarymason
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtablecanarymason
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3John Bertucci
 
Becoming a Respected WordPress Developer
Becoming a Respected WordPress DeveloperBecoming a Respected WordPress Developer
Becoming a Respected WordPress DeveloperDavid Wolfpaw
 
Communicating animation slides
Communicating animation slidesCommunicating animation slides
Communicating animation slidesRachel Nabors
 

What's hot (20)

Css external style sheet
Css external style sheetCss external style sheet
Css external style sheet
 
PSD to Theme: The SMACSS Way
PSD to Theme: The SMACSS WayPSD to Theme: The SMACSS Way
PSD to Theme: The SMACSS Way
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
Object oriented css graeme blackwood
Object oriented css graeme blackwoodObject oriented css graeme blackwood
Object oriented css graeme blackwood
 
CSS 3, Style and Beyond
CSS 3, Style and BeyondCSS 3, Style and Beyond
CSS 3, Style and Beyond
 
Web
WebWeb
Web
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Camp
 
Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010Designing in the Browser - Design for Drupal, Boston 2010
Designing in the Browser - Design for Drupal, Boston 2010
 
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStartIntro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
 
Designing & Developing for Content in WordPress
Designing & Developing for Content in WordPressDesigning & Developing for Content in WordPress
Designing & Developing for Content in WordPress
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphia
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
Drupaldelphia Shortcuts Cheats And Cheap Stunts
Drupaldelphia  Shortcuts Cheats And Cheap StuntsDrupaldelphia  Shortcuts Cheats And Cheap Stunts
Drupaldelphia Shortcuts Cheats And Cheap Stunts
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtable
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3
 
Becoming a Respected WordPress Developer
Becoming a Respected WordPress DeveloperBecoming a Respected WordPress Developer
Becoming a Respected WordPress Developer
 
Communicating animation slides
Communicating animation slidesCommunicating animation slides
Communicating animation slides
 

Viewers also liked

Final Presentation On Briquetting Of Coal
Final Presentation On Briquetting Of CoalFinal Presentation On Briquetting Of Coal
Final Presentation On Briquetting Of CoalMohammad Faisal Baloch
 
How to make fuel briquettes without a press
How to make fuel briquettes without a pressHow to make fuel briquettes without a press
How to make fuel briquettes without a pressJoyce Lockard
 
Mineral processing ii
Mineral processing iiMineral processing ii
Mineral processing iiAli Wassan
 
Pellet Presentation
Pellet PresentationPellet Presentation
Pellet PresentationGregorio
 
State of the Word 2011
State of the Word 2011State of the Word 2011
State of the Word 2011photomatt
 

Viewers also liked (7)

Biomass Briquette
Biomass Briquette Biomass Briquette
Biomass Briquette
 
Final Presentation On Briquetting Of Coal
Final Presentation On Briquetting Of CoalFinal Presentation On Briquetting Of Coal
Final Presentation On Briquetting Of Coal
 
Biomass Briquette
Biomass BriquetteBiomass Briquette
Biomass Briquette
 
How to make fuel briquettes without a press
How to make fuel briquettes without a pressHow to make fuel briquettes without a press
How to make fuel briquettes without a press
 
Mineral processing ii
Mineral processing iiMineral processing ii
Mineral processing ii
 
Pellet Presentation
Pellet PresentationPellet Presentation
Pellet Presentation
 
State of the Word 2011
State of the Word 2011State of the Word 2011
State of the Word 2011
 

Similar to Css Architecture

Css Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder
 
GTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshersGTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshersTOPS Technologies
 
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...New Tricks
 
An Introduction to CSS Frameworks
An Introduction to CSS FrameworksAn Introduction to CSS Frameworks
An Introduction to CSS FrameworksAdrian Westlake
 
Thoughtful theming
Thoughtful themingThoughtful theming
Thoughtful themingonefinejay
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
Design and CSS
Design and CSSDesign and CSS
Design and CSSnolly00
 
The World of Stylesheet Languages
The World of Stylesheet LanguagesThe World of Stylesheet Languages
The World of Stylesheet LanguagesAndrea Tino
 
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
 
Make Your Site Faster: How to Improve Front-End Performance Strategy
Make Your Site Faster: How to Improve Front-End Performance StrategyMake Your Site Faster: How to Improve Front-End Performance Strategy
Make Your Site Faster: How to Improve Front-End Performance StrategyAcquia
 
70 Expert Ideas For Better Css
70 Expert Ideas For Better Css70 Expert Ideas For Better Css
70 Expert Ideas For Better Cssfherz
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Podcast Assignment - 130
Podcast Assignment - 130Podcast Assignment - 130
Podcast Assignment - 130rbrosius
 
Introduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for DevelopersIntroduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for DevelopersMelvin John
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetNeha Sharma
 

Similar to Css Architecture (20)

Css Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder.com | Cssfounder se
Css Founder.com | Cssfounder se
 
GTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshersGTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshers
 
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
WordCamp Atlanta 2014 - CSS For Beginners - By Michael Earley of ATL Squared ...
 
An Introduction to CSS Frameworks
An Introduction to CSS FrameworksAn Introduction to CSS Frameworks
An Introduction to CSS Frameworks
 
Thoughtful theming
Thoughtful themingThoughtful theming
Thoughtful theming
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
Design and CSS
Design and CSSDesign and CSS
Design and CSS
 
The World of Stylesheet Languages
The World of Stylesheet LanguagesThe World of Stylesheet Languages
The World of Stylesheet Languages
 
Full
FullFull
Full
 
CSS 101
CSS 101CSS 101
CSS 101
 
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
 
Make Your Site Faster: How to Improve Front-End Performance Strategy
Make Your Site Faster: How to Improve Front-End Performance StrategyMake Your Site Faster: How to Improve Front-End Performance Strategy
Make Your Site Faster: How to Improve Front-End Performance Strategy
 
70 Expert Ideas For Better Css
70 Expert Ideas For Better Css70 Expert Ideas For Better Css
70 Expert Ideas For Better Css
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
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
 
Podcast Assignment - 130
Podcast Assignment - 130Podcast Assignment - 130
Podcast Assignment - 130
 
Introduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for DevelopersIntroduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for Developers
 
Roadmap 01
Roadmap 01Roadmap 01
Roadmap 01
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome Stylesheet
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Css Architecture

Editor's Notes

  1. CSS started out as a broken language with little to no support, and it still has some of that reputation today, but its getting much better
  2. I’ve noticed a few common issues throughout all of our sites that I would just like to clear up any confusion and help us all to write the best code we can
  3. This is a lot of files to go through, especially if you are trying to find a single css rule or even worse, trying to resolve conflicts between css rules. How can we make it better?
  4. In the cobrand specific CSS file, only elements that will change for the cobrand should be included, such as colors and fonts. Structural elements that will not change should remain in the main CSS. It is not necessary to create a new CSS file for 10 lines of CSS; rather, it would be better to add the code to an existing file.
  5. Theres a lot going on here, and that style attribute is making things harder to read. Is there a way we can simplify this code?
  6. Inline styles are generally a bad idea and should be avoided whenever possible. I can only think of one extremely rare case where inline styles should be used, and I’m not going to tell you because you would know it!If something is 0, it doesn’t need a unit of measurement, zero is zero in anything
  7. When switching from table layouts to tableless layouts you may feel like you can just replace every instance of a table or td tag with a div, but this is rarely the case. Generally, the only times you should use a div tag is when there is no other tag that would make sense to use in that situation, such as structural elements like headers. Typically our pages will follow some resemblance to this structureThere may be other places where a div may be absolutely necessary, but before you automatically use a div, try to think of how the element will be used and if another tag would be better suited in its place.
  8. Be consistent with your naming, whether you use dashes or camel case or whatever, use the same thing, and I’ve been told its good practice to follow with whats been established before, so keep that in mindEven more important is how you are naming your elements. You want to name your classes and id’s based on what that element is, like a header, or special link, and not on what color the element is or where on the page it is. It would be pretty confusing working on a class called blue-link-left if the element was actually red and on the right
  9. I’m sure you’ve seen this somewhere in our css files, and you might be thinking to yourself right now what exactly this hack does. But guess what?
  10. The so called “star hack” is meant to target ie browsers before ie 7, which means that anytime you write this hack, whatever you are trying to hack will still be broken in later versions of ie. But if you’ve ever worked with css and ie, you know how frustrating it can be. That’s why there is an acceptable way to target ie browsers
  11. This is called a conditional comment, and right now is the only acceptable and official way to target ie specific browsers. The first example is saying that if the browser is less than or equal to IE 7, do thisThe second example is calling an ie specific css file for all versions of ie
  12. So when writing your code, and you happen upon an area where you think you need a hack, ask yourself a few questions first
  13. So you can see that this page is easily separated into columns and rows
  14. So on this page, you might be thinking of various places where a table might be needed, like in the top navigation. But is that true? Lets look at the code.
  15. So instead of using a table for this, which would have involved many more lines of code, and possibly some spacer images, we see that here it is a simple unordered list. And isn’t that all a navigation menu is anyway, just a list of links?
  16. So really, we are taking out all of the presentational elements from the HTML, and putting that in the CSS. That was the original purpose of CSS, to separate content from layout, and this idea still holds true today
  17. You can style tags directly by using the tag name with no period or hash before The difference here is that there is no class on the p tag, which means less overhead, easier to read, better maintainabilityThis is a small example, but in situations where there are a lot of the same types of elements, the benefits will be more apparent
  18. Lets build upon an earlier example
  19. So by adding the class to a parent element and referencing it there, we can style more common elements with less amount of code
  20. Since these tags both look exactly the same, its better to combine the styles into one by separating with a comma, and this will make it more readable and easier to change later
  21. Also using shorthand rules will make your code cleaner and smallerSo as we can see here, we are using shorthand rules in 3 areas, for margin, color, and font
  22. put a color and layout glossary at the top of your css to make things like colors and sizes easier to findFlag different sections like “starTags” or “starMain” to make it easier to jump to those sections with control F
  23. If you’ve ever asked me for help for a layout problem, my first question to you is usually “have you validated?” What might seem like a small problem can often be a symptom of a larger issue. If tags aren’t closed or even in the wrong order, it could make the entire page unpredictable in other browsers. Also there are other visitors to our sites who look only at code, which is search engines. While its not strictly proven that and invalid page will always rank lower than a valid page, (although there have been tests done) it makes sense that these spiders would have an easier time moving through our pages if they were written correctly.
  24. It has been mentioned that floats are one of the more difficult aspects of CSS, so I thought I’d take a few moments to talk about themElements following a floated element will wrap around the floated element.So if you have content flowing around a floated element, but you don’t want it to wrap, then you need to clear the float. The best way to do it is to pick the next element and put the clear declaration on it, but sometimes that’s not possible, so you can use this code to do it
  25. Any questions?