SlideShare a Scribd company logo
JavierEspaña
                                               CSS GOOD PRACTICES
                                               FOR TEAMWORK AND BIG SCALE PROJECTS
                                               We've all been through the bad experience of taking a project and find
                                               absolute chaos on the stylesheet and/or discover that each member of
                                               the team has done things their way. Let's not even talk about retaking a
                                               project after a long time and not being able to find what we did or how
                                               we did it.
                                               This talk tries to give solutions to these issues for a better
                                               development and the organization of our projects, specially in the use
                                               of CSS.




        Introduction                                    Practices                                                  Questions
A brief intro to the talk and my 10 years of   We will lay out the issues of big scale                    I’ll hear your questions and we’ll try to find
experience in design and web development.      development and it’s solutions.                            solutions to them.




                                                                                                                                                     Contact
©JavierEspaña                                                                            Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana
INTERESTED IN THIS TALK?
                  If you want me to give this conference at your event,
                    company or even via online meeting contact me:
                               info@javierespana.com




                             Please don’t steal this material




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   1
DESIGN AND WEB DEVELOPMENT
BRIEF INTRODUCTION




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   2
DESIGN AND WEB DEVELOPMENT
SOME WORDS ABOUT ME




                                                                           javierespana.com




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   3
DESIGN AND WEB DEVELOPMENT
SOME OF MY WORKS




            MTV EMA 2011                                     Steve Argyle                               Kid’s Choice Awards 2011
          http://ema.mtv.co.uk/                     http://www.steveargyle.com/                          http://kca.mundonick.com/




JavierEspaña                      Contact
                                  Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana                                4
DESIGN AND WEB DEVELOPMENT
SOME OF MY WORKS




            Cuenca D’Amico                                   MTV at the Movies                                    Sunmesa Events
     http://www.cuencadamico.com.ar/                        http://movies.mtv.co.uk/                         http://www.sunmesaevents.com/




JavierEspaña                           Contact
                                       Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana                                   5
DESIGN AND WEB DEVELOPMENT
ABOUT THIS TALK




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   6
DESIGN AND WEB DEVELOPMENT
GOOD PRACTICES




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   7
DESIGN AND WEB DEVELOPMENT
BE ORGANIZED
  Create and mantain a correct folder structure for your projects




                                                                 vs




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   8
DESIGN AND WEB DEVELOPMENT
BE ORGANIZED
  Separate and index CSS using comments




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   9
DESIGN AND WEB DEVELOPMENT
USE COMMENTS
  Take advantage of them to leave notes for future developers




                                                                 +




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   10
DESIGN AND WEB DEVELOPMENT
USE RESET STYLESHEETS
  They are essential for any good cross-browser development




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   11
DESIGN AND WEB DEVELOPMENT
PAY ATTENTION TO NAMES
  Give classes semantic sense




                                                                   vs




JavierEspaña                    Contact
                                Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   12
DESIGN AND WEB DEVELOPMENT
PAY ATTENTION TO NAMES
  Make reading the CSS easier using lowercase selectors and properties




                                                                vs




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   13
DESIGN AND WEB DEVELOPMENT
PAY ATTENTION TO NAMES
  Group up selectors to make the reading and updates easier




                                                                vs




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   14
DESIGN AND WEB DEVELOPMENT
MIND YOUR WRITING
  Take a team desition and make it count




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   15
DESIGN AND WEB DEVELOPMENT
MIND YOUR WRITING
  Choose and easy way for everyone to follow




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   16
DESIGN AND WEB DEVELOPMENT
MIND YOUR WRITING
  Short notation help you keep the code clean




                                                                vs




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   17
DESIGN AND WEB DEVELOPMENT
MIND YOUR WRITING
  Again, group up selectors with the same behavior




                                                                vs




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   18
DESIGN AND WEB DEVELOPMENT
MIND YOUR WRITING
  Avoid using long selectors without a need




                                                                 vs




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   19
DESIGN AND WEB DEVELOPMENT
A QUICK NOTE
                             ABOUT SPECIFICITY



JavierEspaña                   Contact
                               Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   20
DESIGN AND WEB DEVELOPMENT
WHAT IS SPECIFICITY?
  It’s the way CSS determines which rule takes precedence for an object




            0                           1                                                2                     3
            Inline                      IDs                                           Classes               Elements
                                                                            Pseudo-classes & Attributes   Pseudo-Elements




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana                           21
DESIGN AND WEB DEVELOPMENT
WHAT IS SPECIFICITY?
  It’s the way CSS determines which rule takes precedence for an object




       0                       0                                                0                         0
                  0                            0                                                    1               0
            Inline                      IDs                                           Classes               Elements
                                                                            Pseudo-classes & Attributes   Pseudo-Elements




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana                           22
DESIGN AND WEB DEVELOPMENT
WHAT IS SPECIFICITY?
  It’s the way CSS determines which rule takes precedence for an object




       0                       1                                                1                         1
                  1                            0                                                    0               0
            Inline                      IDs                                           Classes               Elements
                                                                            Pseudo-classes & Attributes   Pseudo-Elements




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana                           23
DESIGN AND WEB DEVELOPMENT
BACK TO
                             GOOD PRACTICES



JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   24
DESIGN AND WEB DEVELOPMENT
DIFFERENT BROWSERS
  You can approach the issue with different stylesheets or CSS hacks




               Javascript                             Condicionales IE                              CSS Hacks




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana               25
DESIGN AND WEB DEVELOPMENT
TAKE ADVANTAGE
                  OF THE NEW PRACTICES



JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   26
DESIGN AND WEB DEVELOPMENT
CONDITIONAL IE COMMENTS
  Declare your documents using different classes for each browser




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   27
DESIGN AND WEB DEVELOPMENT
ORGANIZE YOUR CSS3
  Keep your new CSS3 declarations ordered correctly to avoid future issues




                                                                  +




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   28
DESIGN AND WEB DEVELOPMENT
GENERAL RULES




JavierEspaña                  Contact
                              Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   29
DESIGN AND WEB DEVELOPMENT
IMPORTANT DETAILS
  Things we should not forget in our developments




                Validate                                     Minify                                Techniques / Scripts




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana                          30
DESIGN AND WEB DEVELOPMENT
THANK YOU!




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   31
DESIGN AND WEB DEVELOPMENT
KEEP IN TOUCH
                                  Web: javierespana.com
                                       Blog: moonward.net
                                   Twitter: @javierespana




                             QUESTIONS?

JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   32
DESIGN AND WEB DEVELOPMENT
THANKS FOR YOUR TIME!




JavierEspaña                 Contact
                             Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana   33
DESIGN AND WEB DEVELOPMENT

More Related Content

PPTX
PPT
Techforgood stories
PPT
Presentation on a collaboration with London Probation Services WS72
PPTX
上台本事 闡德
PPTX
AIDSTAR-One Field Support Workplan FY 2011
DOC
Media Arts: Web Design
DOCX
Ellison Thesis
PPT
Siemenshrstrategy 124839121309-phpapp01
Techforgood stories
Presentation on a collaboration with London Probation Services WS72
上台本事 闡德
AIDSTAR-One Field Support Workplan FY 2011
Media Arts: Web Design
Ellison Thesis
Siemenshrstrategy 124839121309-phpapp01

Viewers also liked (10)

PPTX
ベトナムのバイクについて
PPTX
facts of Germany
PPTX
Communicating research. Lessons from advertising and journalism
PDF
A taxonomy of search strategies and their design implications
PPTX
ベトナム家庭訪問レポート(ホーチミン富裕層宅)
PPTX
Historia de la pintura dominicana
PPTX
La historia de la pintura
PPT
Germany- Complete culture of Germany in one presentation
PPTX
Egnergy Presentation
ベトナムのバイクについて
facts of Germany
Communicating research. Lessons from advertising and journalism
A taxonomy of search strategies and their design implications
ベトナム家庭訪問レポート(ホーチミン富裕層宅)
Historia de la pintura dominicana
La historia de la pintura
Germany- Complete culture of Germany in one presentation
Egnergy Presentation
Ad

Similar to CSS Good Practices (20)

PDF
Mind the Gap - State of the Browser 2015
PDF
Programming for Non-Programmers - SXSW Vegas 2014
PDF
The State of the Web - Helsinki meetup
PPTX
Personal Branding
PDF
Erase and Rewind - Open Web Camp 2015
PDF
Rapid Fullstack Development
PDF
2Creating Connecting Cultivating Learning Communities
PDF
Programming for Non-programmers PFNP @ Razorfish
PPTX
Vine presentation
KEY
Surviving (and Thriving in) the Online Identity Wars
PDF
CANVA TUTORIAL FOR BEGINNERS
PPTX
TourVine-phpapp01
PPTX
Are We There Yet? Create, Manage & Measure Your Web Campaign Success
PDF
Designer vs Developer: BE THE UNICORN
PDF
How to Launch an Online Business Doing What You Love
PDF
Bridging the Gap: From WordPress beginner to WordPress Wizard
PPTX
Winning building 201_all_day
PPT
Blending Social Media in WordPress
PPT
Building your base
PPTX
First Go at Office Sway
Mind the Gap - State of the Browser 2015
Programming for Non-Programmers - SXSW Vegas 2014
The State of the Web - Helsinki meetup
Personal Branding
Erase and Rewind - Open Web Camp 2015
Rapid Fullstack Development
2Creating Connecting Cultivating Learning Communities
Programming for Non-programmers PFNP @ Razorfish
Vine presentation
Surviving (and Thriving in) the Online Identity Wars
CANVA TUTORIAL FOR BEGINNERS
TourVine-phpapp01
Are We There Yet? Create, Manage & Measure Your Web Campaign Success
Designer vs Developer: BE THE UNICORN
How to Launch an Online Business Doing What You Love
Bridging the Gap: From WordPress beginner to WordPress Wizard
Winning building 201_all_day
Blending Social Media in WordPress
Building your base
First Go at Office Sway
Ad

Recently uploaded (20)

PPTX
Chapter 5: Probability Theory and Statistics
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
Modernising the Digital Integration Hub
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Five Habits of High-Impact Board Members
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPT
What is a Computer? Input Devices /output devices
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
STKI Israel Market Study 2025 version august
PDF
Getting started with AI Agents and Multi-Agent Systems
Chapter 5: Probability Theory and Statistics
A review of recent deep learning applications in wood surface defect identifi...
Modernising the Digital Integration Hub
Enhancing emotion recognition model for a student engagement use case through...
Module 1.ppt Iot fundamentals and Architecture
Five Habits of High-Impact Board Members
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Final SEM Unit 1 for mit wpu at pune .pptx
Taming the Chaos: How to Turn Unstructured Data into Decisions
What is a Computer? Input Devices /output devices
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
sustainability-14-14877-v2.pddhzftheheeeee
A contest of sentiment analysis: k-nearest neighbor versus neural network
WOOl fibre morphology and structure.pdf for textiles
NewMind AI Weekly Chronicles – August ’25 Week III
DP Operators-handbook-extract for the Mautical Institute
Hindi spoken digit analysis for native and non-native speakers
Univ-Connecticut-ChatGPT-Presentaion.pdf
STKI Israel Market Study 2025 version august
Getting started with AI Agents and Multi-Agent Systems

CSS Good Practices

  • 1. JavierEspaña CSS GOOD PRACTICES FOR TEAMWORK AND BIG SCALE PROJECTS We've all been through the bad experience of taking a project and find absolute chaos on the stylesheet and/or discover that each member of the team has done things their way. Let's not even talk about retaking a project after a long time and not being able to find what we did or how we did it. This talk tries to give solutions to these issues for a better development and the organization of our projects, specially in the use of CSS. Introduction Practices Questions A brief intro to the talk and my 10 years of We will lay out the issues of big scale I’ll hear your questions and we’ll try to find experience in design and web development. development and it’s solutions. solutions to them. Contact ©JavierEspaña Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana
  • 2. INTERESTED IN THIS TALK? If you want me to give this conference at your event, company or even via online meeting contact me: info@javierespana.com Please don’t steal this material JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 1 DESIGN AND WEB DEVELOPMENT
  • 3. BRIEF INTRODUCTION JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 2 DESIGN AND WEB DEVELOPMENT
  • 4. SOME WORDS ABOUT ME javierespana.com JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 3 DESIGN AND WEB DEVELOPMENT
  • 5. SOME OF MY WORKS MTV EMA 2011 Steve Argyle Kid’s Choice Awards 2011 http://ema.mtv.co.uk/ http://www.steveargyle.com/ http://kca.mundonick.com/ JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 4 DESIGN AND WEB DEVELOPMENT
  • 6. SOME OF MY WORKS Cuenca D’Amico MTV at the Movies Sunmesa Events http://www.cuencadamico.com.ar/ http://movies.mtv.co.uk/ http://www.sunmesaevents.com/ JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 5 DESIGN AND WEB DEVELOPMENT
  • 7. ABOUT THIS TALK JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 6 DESIGN AND WEB DEVELOPMENT
  • 8. GOOD PRACTICES JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 7 DESIGN AND WEB DEVELOPMENT
  • 9. BE ORGANIZED Create and mantain a correct folder structure for your projects vs JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 8 DESIGN AND WEB DEVELOPMENT
  • 10. BE ORGANIZED Separate and index CSS using comments JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 9 DESIGN AND WEB DEVELOPMENT
  • 11. USE COMMENTS Take advantage of them to leave notes for future developers + JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 10 DESIGN AND WEB DEVELOPMENT
  • 12. USE RESET STYLESHEETS They are essential for any good cross-browser development JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 11 DESIGN AND WEB DEVELOPMENT
  • 13. PAY ATTENTION TO NAMES Give classes semantic sense vs JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 12 DESIGN AND WEB DEVELOPMENT
  • 14. PAY ATTENTION TO NAMES Make reading the CSS easier using lowercase selectors and properties vs JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 13 DESIGN AND WEB DEVELOPMENT
  • 15. PAY ATTENTION TO NAMES Group up selectors to make the reading and updates easier vs JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 14 DESIGN AND WEB DEVELOPMENT
  • 16. MIND YOUR WRITING Take a team desition and make it count JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 15 DESIGN AND WEB DEVELOPMENT
  • 17. MIND YOUR WRITING Choose and easy way for everyone to follow JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 16 DESIGN AND WEB DEVELOPMENT
  • 18. MIND YOUR WRITING Short notation help you keep the code clean vs JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 17 DESIGN AND WEB DEVELOPMENT
  • 19. MIND YOUR WRITING Again, group up selectors with the same behavior vs JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 18 DESIGN AND WEB DEVELOPMENT
  • 20. MIND YOUR WRITING Avoid using long selectors without a need vs JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 19 DESIGN AND WEB DEVELOPMENT
  • 21. A QUICK NOTE ABOUT SPECIFICITY JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 20 DESIGN AND WEB DEVELOPMENT
  • 22. WHAT IS SPECIFICITY? It’s the way CSS determines which rule takes precedence for an object 0 1 2 3 Inline IDs Classes Elements Pseudo-classes & Attributes Pseudo-Elements JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 21 DESIGN AND WEB DEVELOPMENT
  • 23. WHAT IS SPECIFICITY? It’s the way CSS determines which rule takes precedence for an object 0 0 0 0 0 0 1 0 Inline IDs Classes Elements Pseudo-classes & Attributes Pseudo-Elements JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 22 DESIGN AND WEB DEVELOPMENT
  • 24. WHAT IS SPECIFICITY? It’s the way CSS determines which rule takes precedence for an object 0 1 1 1 1 0 0 0 Inline IDs Classes Elements Pseudo-classes & Attributes Pseudo-Elements JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 23 DESIGN AND WEB DEVELOPMENT
  • 25. BACK TO GOOD PRACTICES JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 24 DESIGN AND WEB DEVELOPMENT
  • 26. DIFFERENT BROWSERS You can approach the issue with different stylesheets or CSS hacks Javascript Condicionales IE CSS Hacks JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 25 DESIGN AND WEB DEVELOPMENT
  • 27. TAKE ADVANTAGE OF THE NEW PRACTICES JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 26 DESIGN AND WEB DEVELOPMENT
  • 28. CONDITIONAL IE COMMENTS Declare your documents using different classes for each browser JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 27 DESIGN AND WEB DEVELOPMENT
  • 29. ORGANIZE YOUR CSS3 Keep your new CSS3 declarations ordered correctly to avoid future issues + JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 28 DESIGN AND WEB DEVELOPMENT
  • 30. GENERAL RULES JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 29 DESIGN AND WEB DEVELOPMENT
  • 31. IMPORTANT DETAILS Things we should not forget in our developments Validate Minify Techniques / Scripts JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 30 DESIGN AND WEB DEVELOPMENT
  • 32. THANK YOU! JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 31 DESIGN AND WEB DEVELOPMENT
  • 33. KEEP IN TOUCH Web: javierespana.com Blog: moonward.net Twitter: @javierespana QUESTIONS? JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 32 DESIGN AND WEB DEVELOPMENT
  • 34. THANKS FOR YOUR TIME! JavierEspaña Contact Web: javierespana.com / Blog: moonward.net / Twitter: @javierespana 33 DESIGN AND WEB DEVELOPMENT