SlideShare une entreprise Scribd logo
1  sur  15
If you manage big CSS, probably you
will know hundreds of frameworks to
     help developing new projects...
• Grids: Blueprint, YUI Grids, Compass, Scaffold,...
• Stylesheet meta-languages: SASS, LESS,...
• Object-Oriented: OOCSS
But...
Is anybody worried about
    the order of CSS?
         At least i do...
div.messy {
•   CSS can be written as you want, it should work, but        font-color: blue;
                                                               overflow: hidden;
    have you thought in your teammates?
                                                               display: none;
•   You could avoid some discussions with other Css            height: auto;
                                                               position: absolute;
    developers.
                                                               font-size: 15px;
                                                               text-decoration: none;
•   People who don’t play with CSS everyday can help you       box-shadow: 0 1px black;
    without add more complexity to the file.                    -webkit-border-radius: 5px;
                                                               width:100px;
•   Waste time searching properties in a reaaaally large       font-style: normal;
    CSS class.                                                 letter-spacing: -1px;
                                                               background: url(‘../lol.png’);
•   If in your team there are more than 2 developers,          margin-top: 20px;
    I think this is a must.                                    padding-bottom: 10px;
                                                               ...
                                                           }
So, this is my proposal...
      It likely shouldn’t fit for you
Classification & positioning 1/5
•   First should be the classification and positioning of
                                                           div.less_messy {
    the “box”.
                                                               clear: left;
•   Importance queue?, it could be:                            display: block;
                                                               position: absolute;
    - clear                                                    top: 4px;
    - display                                                  right: 3px;
    - position                                                 bottom: 5px;
    - top || right || bottom || left                           left: 2px;
    - z-index                                                  z-index: 10;
    - float                                                     float: none;
    - overflow                                                  overflow: auto;
    - vertical-align
    ...                                                        ...
                                                           }
•   As we know, some properties depend on previous ones.
Dimension 2/5


•   Now is time to declare the object dimensions.
                                                                 div.less_messy {
•   The list is:                                                   ...
    - width (min|max)                                                width: 150px;
    - height (min|max)                                               height: 20px;
    - padding                                                        padding: 10px 5px 3px;
    - margin                                                         margin: 3px;
                                                                     ...
•   It’s true that margin property should be in positioning      }
    chapter, but I’ve always thought it has to be written with
    height, width and padding (mania?).
Box 3/5
•   Is box a pretty good title name? I’m not really sure, but we
    are going to style it ;).
                                                                   div.less_messy {
•   SOME of these properties would be:                               ...
    - background                                                       background: red;
    - box-shadow                                                       box-shadow: 0 1px black;
    - border                                                           border: none;
    - zoom                                                             translate: rotate(45deg);
    - translate                                                        border-radius: 3px;
    - border-radius                                                    ...
    - border-image
    ...                                                            }

•   There is no importance of order...
Text 4/5

•   And almost last, but no less important.

                                                 div.less_messy {
•   Just a few of them:
                                                   ...
    - font                                           font: normal 11px Arial;
    - color
                                                     color: rgba(0,0,0,0.7);
    - text-decoration
                                                     text-decoration: none;
    - letter-spacing
                                                     line-height: 11px;
    - text-transform
    - line-height                                    text-transform: uppercase;
    - text-align                                     ...
    - word-spacing
    ...
                                                 }

•   A great idea is put color after font, why?
    I don’t know, who cares?
div.less_messy {
End 5/5                                                         clear: left;
                                                                display: block;
                                                                position: absolute;
•   There are some (... several) of properties do not           top: 4px;
                                                                right: 3px;
    specified here, like list, table,... don’t worry, just       bottom: 5px;
    order yourself to keep clean your CSS.                      left: 2px;
                                                                z-index: 10;
                                                                float: none;
•   This is an example of CSS order guide.                      overflow: auto;
                                                                width: 150px;
                                                                height: 20px;
•   Let’s make it clear together.                               padding: 10px 5px 3px;
                                                                margin: 3px;
                                                                background: red;
                                                                box-shadow: 0 1px black;
                                                                border: none;
                                                                translate: rotate(45deg);
                                                                border-radius: 3px;
                                                                font: normal 11px Arial;
                                                                color: rgba(0,0,0,0.7);
                                                                text-decoration: none;

•   Some advices? why not, go next slide.                       line-height: 11px;

                                                                text-transform: uppercase;

                                                            }
Advices! 1/2

    •   Try to avoid using long style of the property, e.g. border, margin, etc.

        border-color: red;
        border-style: solid;
        border-width: 1px;

        border: 1px solid red;



    •   But if you want to change just a single property with a new class (e.g.), it’s
        time to use minified property...
        border: 1px solid blue;

        border-color: blue;
Advices! 2/2

    •   There are some specific CSS3 properties for each browser, write all followed:
        translate: rotate(45deg);
        -moz-translate: rotate(45deg);
        -ms-translate: rotate(45deg)
        ...



    •   Do the same with the “hacks” for IE (in case you use them of course...):
        border: 1px solid blue;
        border: 1px solid white8;
        border: 1px solid white9;
Remember once more!

This is not a guide to improve the world, use just
            in case you find it useful...
Thanks! :-)
  xavijam.github.com

Contenu connexe

En vedette

Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011m-libraries
 
Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011m-libraries
 
M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010m-libraries
 
Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011m-libraries
 
Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011m-libraries
 
Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010m-libraries
 
Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011m-libraries
 

En vedette (7)

Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011Mlibraries 3 flyer March 2011
Mlibraries 3 flyer March 2011
 
Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011Evolving content for mobile delivery report march 2011
Evolving content for mobile delivery report march 2011
 
M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010M libraries2 beds uni mlibraries seminar May 2010
M libraries2 beds uni mlibraries seminar May 2010
 
Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011Mlibraries 3 ebooks in he opportunities and challenges March 2011
Mlibraries 3 ebooks in he opportunities and challenges March 2011
 
Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011Mlibraries 3 workshop leaners on the move a developers view March 2011
Mlibraries 3 workshop leaners on the move a developers view March 2011
 
Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010Mlibraries2 ou library mlibraries seminar May 2010
Mlibraries2 ou library mlibraries seminar May 2010
 
Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011Mlibraries 3 workshop the role of mobile in research & teaching March 2011
Mlibraries 3 workshop the role of mobile in research & teaching March 2011
 

Similaire à Messy css

Simplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and NibSimplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and NibChristian Joudrey
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPressJustin Carmony
 
JDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 DiabetesJDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 Diabetesstella6copeland43
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
Html standards presentation
Html standards presentationHtml standards presentation
Html standards presentationTiago Cardoso
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperWynn Netherland
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandThemePartner
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
HTML and CSS Help I have an assignment where I need to recreate th.pdf
HTML and CSS Help  I have an assignment where I need to recreate th.pdfHTML and CSS Help  I have an assignment where I need to recreate th.pdf
HTML and CSS Help I have an assignment where I need to recreate th.pdfpratyushraj61
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)elliando dias
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsMo Jangda
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS LayoutZoe Gillenwater
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]ThemePartner
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
 

Similaire à Messy css (20)

Simplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and NibSimplify your CSS with Stylus and Nib
Simplify your CSS with Stylus and Nib
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPress
 
JDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 DiabetesJDRF: Improving Lives. Curing Type 1 Diabetes
JDRF: Improving Lives. Curing Type 1 Diabetes
 
Sass compass
Sass compassSass compass
Sass compass
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Html standards presentation
Html standards presentationHtml standards presentation
Html standards presentation
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day Deutschland
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
HTML and CSS Help I have an assignment where I need to recreate th.pdf
HTML and CSS Help  I have an assignment where I need to recreate th.pdfHTML and CSS Help  I have an assignment where I need to recreate th.pdf
HTML and CSS Help I have an assignment where I need to recreate th.pdf
 
Cloudstack UI Customization
Cloudstack UI CustomizationCloudstack UI Customization
Cloudstack UI Customization
 
Css3
Css3Css3
Css3
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwords
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS Layout
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]
 
CSS and Layout
CSS and LayoutCSS and Layout
CSS and Layout
 
DotNetNuke World CSS3
DotNetNuke World CSS3DotNetNuke World CSS3
DotNetNuke World CSS3
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 

Dernier

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Dernier (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Messy css

  • 1. If you manage big CSS, probably you will know hundreds of frameworks to help developing new projects...
  • 2. • Grids: Blueprint, YUI Grids, Compass, Scaffold,... • Stylesheet meta-languages: SASS, LESS,... • Object-Oriented: OOCSS
  • 4. Is anybody worried about the order of CSS? At least i do...
  • 5. div.messy { • CSS can be written as you want, it should work, but font-color: blue; overflow: hidden; have you thought in your teammates? display: none; • You could avoid some discussions with other Css height: auto; position: absolute; developers. font-size: 15px; text-decoration: none; • People who don’t play with CSS everyday can help you box-shadow: 0 1px black; without add more complexity to the file. -webkit-border-radius: 5px; width:100px; • Waste time searching properties in a reaaaally large font-style: normal; CSS class. letter-spacing: -1px; background: url(‘../lol.png’); • If in your team there are more than 2 developers, margin-top: 20px; I think this is a must. padding-bottom: 10px; ... }
  • 6. So, this is my proposal... It likely shouldn’t fit for you
  • 7. Classification & positioning 1/5 • First should be the classification and positioning of div.less_messy { the “box”. clear: left; • Importance queue?, it could be: display: block; position: absolute; - clear top: 4px; - display right: 3px; - position bottom: 5px; - top || right || bottom || left left: 2px; - z-index z-index: 10; - float float: none; - overflow overflow: auto; - vertical-align ... ... } • As we know, some properties depend on previous ones.
  • 8. Dimension 2/5 • Now is time to declare the object dimensions. div.less_messy { • The list is: ... - width (min|max) width: 150px; - height (min|max) height: 20px; - padding padding: 10px 5px 3px; - margin margin: 3px; ... • It’s true that margin property should be in positioning } chapter, but I’ve always thought it has to be written with height, width and padding (mania?).
  • 9. Box 3/5 • Is box a pretty good title name? I’m not really sure, but we are going to style it ;). div.less_messy { • SOME of these properties would be: ... - background background: red; - box-shadow box-shadow: 0 1px black; - border border: none; - zoom translate: rotate(45deg); - translate border-radius: 3px; - border-radius ... - border-image ... } • There is no importance of order...
  • 10. Text 4/5 • And almost last, but no less important. div.less_messy { • Just a few of them: ... - font font: normal 11px Arial; - color color: rgba(0,0,0,0.7); - text-decoration text-decoration: none; - letter-spacing line-height: 11px; - text-transform - line-height text-transform: uppercase; - text-align ... - word-spacing ... } • A great idea is put color after font, why? I don’t know, who cares?
  • 11. div.less_messy { End 5/5 clear: left; display: block; position: absolute; • There are some (... several) of properties do not top: 4px; right: 3px; specified here, like list, table,... don’t worry, just bottom: 5px; order yourself to keep clean your CSS. left: 2px; z-index: 10; float: none; • This is an example of CSS order guide. overflow: auto; width: 150px; height: 20px; • Let’s make it clear together. padding: 10px 5px 3px; margin: 3px; background: red; box-shadow: 0 1px black; border: none; translate: rotate(45deg); border-radius: 3px; font: normal 11px Arial; color: rgba(0,0,0,0.7); text-decoration: none; • Some advices? why not, go next slide. line-height: 11px; text-transform: uppercase; }
  • 12. Advices! 1/2 • Try to avoid using long style of the property, e.g. border, margin, etc. border-color: red; border-style: solid; border-width: 1px; border: 1px solid red; • But if you want to change just a single property with a new class (e.g.), it’s time to use minified property... border: 1px solid blue; border-color: blue;
  • 13. Advices! 2/2 • There are some specific CSS3 properties for each browser, write all followed: translate: rotate(45deg); -moz-translate: rotate(45deg); -ms-translate: rotate(45deg) ... • Do the same with the “hacks” for IE (in case you use them of course...): border: 1px solid blue; border: 1px solid white8; border: 1px solid white9;
  • 14. Remember once more! This is not a guide to improve the world, use just in case you find it useful...
  • 15. Thanks! :-) xavijam.github.com

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n