[go: up one dir, main page]

SlideShare a Scribd company logo
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS
Practical Maintainable CSS

More Related Content

Viewers also liked (17)

Arquitecturabizantina
ArquitecturabizantinaArquitecturabizantina
Arquitecturabizantina
perezcraviotto
 
TABELA DE JOGOS VETERANOS
TABELA DE JOGOS VETERANOSTABELA DE JOGOS VETERANOS
TABELA DE JOGOS VETERANOS
mariotellesjr
 
El rottweiler
El rottweilerEl rottweiler
El rottweiler
Francisco José Izquierdo López
 
Plan anticorrupción y de atención al ciudadano (1)
Plan anticorrupción y de atención al ciudadano (1)Plan anticorrupción y de atención al ciudadano (1)
Plan anticorrupción y de atención al ciudadano (1)
Juntos Por Hispania
 
Edacl
EdaclEdacl
Edacl
guest9c59d9
 
Prevenção do Cancro: Efeitos dos pesticidas, alimentos geneticamente modifica...
Prevenção do Cancro: Efeitos dos pesticidas, alimentos geneticamente modifica...Prevenção do Cancro: Efeitos dos pesticidas, alimentos geneticamente modifica...
Prevenção do Cancro: Efeitos dos pesticidas, alimentos geneticamente modifica...
Escola Superior de Saúde da Universidade do Algarve
 
16705
1670516705
16705
+ Aloisio Magalhães
 
Miguel Ángel pintor
Miguel Ángel pintorMiguel Ángel pintor
Miguel Ángel pintor
ceobarlovento
 
Micosis sistémicas
Micosis sistémicasMicosis sistémicas
Micosis sistémicas
Alejandro Paredes C.
 
New Rules Of PR
New Rules Of PRNew Rules Of PR
New Rules Of PR
Fabio Platero
 
Arquitectura Popular Tradicional 4
Arquitectura Popular Tradicional 4Arquitectura Popular Tradicional 4
Arquitectura Popular Tradicional 4
Jose joaquin
 
Tema 2.ARTE CLASICO 2. ROMA:Escultura
Tema 2.ARTE CLASICO 2. ROMA:EsculturaTema 2.ARTE CLASICO 2. ROMA:Escultura
Tema 2.ARTE CLASICO 2. ROMA:Escultura
@evasociales
 
Fundacoes ppt
Fundacoes pptFundacoes ppt
Fundacoes ppt
Wanderson Gonçalves
 
Flickr
FlickrFlickr
Flickr
shevaun
 
Frases Célebres
Frases CélebresFrases Célebres
Frases Célebres
walll
 
Renkomäen koulun veso 30.5.2011
Renkomäen koulun veso 30.5.2011Renkomäen koulun veso 30.5.2011
Renkomäen koulun veso 30.5.2011
Jukka Manninen
 
Friendship Week
Friendship WeekFriendship Week
Friendship Week
sutrisno2629
 

More from Natalie Downe (8)

From Idea to Exit, the story of our startup
From Idea to Exit, the story of our startupFrom Idea to Exit, the story of our startup
From Idea to Exit, the story of our startup
Natalie Downe
 
From idea to exit
From idea to exitFrom idea to exit
From idea to exit
Natalie Downe
 
Becoming Accidental Entrepreneurs
Becoming Accidental Entrepreneurs Becoming Accidental Entrepreneurs
Becoming Accidental Entrepreneurs
Natalie Downe
 
Serendipity and Lanyrd
Serendipity and LanyrdSerendipity and Lanyrd
Serendipity and Lanyrd
Natalie Downe
 
Practical Maintainable CSS (short version)
Practical Maintainable CSS (short version)Practical Maintainable CSS (short version)
Practical Maintainable CSS (short version)
Natalie Downe
 
What I learned from making things
What I learned from making thingsWhat I learned from making things
What I learned from making things
Natalie Downe
 
What I Did Holidays
What I Did HolidaysWhat I Did Holidays
What I Did Holidays
Natalie Downe
 
CSS Systems
CSS SystemsCSS Systems
CSS Systems
Natalie Downe
 
From Idea to Exit, the story of our startup
From Idea to Exit, the story of our startupFrom Idea to Exit, the story of our startup
From Idea to Exit, the story of our startup
Natalie Downe
 
Becoming Accidental Entrepreneurs
Becoming Accidental Entrepreneurs Becoming Accidental Entrepreneurs
Becoming Accidental Entrepreneurs
Natalie Downe
 
Serendipity and Lanyrd
Serendipity and LanyrdSerendipity and Lanyrd
Serendipity and Lanyrd
Natalie Downe
 
Practical Maintainable CSS (short version)
Practical Maintainable CSS (short version)Practical Maintainable CSS (short version)
Practical Maintainable CSS (short version)
Natalie Downe
 
What I learned from making things
What I learned from making thingsWhat I learned from making things
What I learned from making things
Natalie Downe
 

Recently uploaded (20)

APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
Association for Project Management
 
Principle and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby BasnetPrinciple and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby Basnet
Boby Basnet
 
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptxTLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
RizaBedayo
 
Useful environment methods in Odoo 18 - Odoo Slides
Useful environment methods in Odoo 18 - Odoo SlidesUseful environment methods in Odoo 18 - Odoo Slides
Useful environment methods in Odoo 18 - Odoo Slides
Celine George
 
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
 
PUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health SystemsPUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health Systems
Jonathan Hallett
 
Modeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptxModeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptx
maribethlacno2
 
Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
 
How to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 InventoryHow to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 Inventory
Celine George
 
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
 
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
The Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom WalkerThe Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom Walker
History of Stoke Newington
 
English 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom ObsEnglish 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom Obs
NerissaMendez1
 
CBSE Arabic Grammar - Class 10 ppt.pptx
CBSE Arabic Grammar - Class 10   ppt.pptxCBSE Arabic Grammar - Class 10   ppt.pptx
CBSE Arabic Grammar - Class 10 ppt.pptx
suhail849886
 
Essentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok SonawalaEssentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok Sonawala
Association for Project Management
 
The Broccoli Dog's inner voice (look A)
The Broccoli Dog's inner voice  (look A)The Broccoli Dog's inner voice  (look A)
The Broccoli Dog's inner voice (look A)
merasan
 
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir DotanThe Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
History of Stoke Newington
 
Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...
Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...
Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...
Ajaz Hussain
 
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptxFESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
DanmarieMuli1
 
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...APM People Interest Network Conference - Tim Lyons - The neurological levels ...
APM People Interest Network Conference - Tim Lyons - The neurological levels ...
Association for Project Management
 
Principle and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby BasnetPrinciple and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby Basnet
Boby Basnet
 
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptxTLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
TLE 7 - 2nd Topic - Codes and Standards in Industrial Arts Services.pptx
RizaBedayo
 
Useful environment methods in Odoo 18 - Odoo Slides
Useful environment methods in Odoo 18 - Odoo SlidesUseful environment methods in Odoo 18 - Odoo Slides
Useful environment methods in Odoo 18 - Odoo Slides
Celine George
 
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
 
PUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health SystemsPUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health Systems
Jonathan Hallett
 
Modeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptxModeling-Simple-Equation-Using-Bar-Models.pptx
Modeling-Simple-Equation-Using-Bar-Models.pptx
maribethlacno2
 
How to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 InventoryHow to Manage Putaway Rule in Odoo 17 Inventory
How to Manage Putaway Rule in Odoo 17 Inventory
Celine George
 
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
 
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
The Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom WalkerThe Story Behind the Abney Park Restoration Project by Tom Walker
The Story Behind the Abney Park Restoration Project by Tom Walker
History of Stoke Newington
 
English 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom ObsEnglish 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom Obs
NerissaMendez1
 
CBSE Arabic Grammar - Class 10 ppt.pptx
CBSE Arabic Grammar - Class 10   ppt.pptxCBSE Arabic Grammar - Class 10   ppt.pptx
CBSE Arabic Grammar - Class 10 ppt.pptx
suhail849886
 
The Broccoli Dog's inner voice (look A)
The Broccoli Dog's inner voice  (look A)The Broccoli Dog's inner voice  (look A)
The Broccoli Dog's inner voice (look A)
merasan
 
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir DotanThe Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
The Battle of Belgrade Road: A WW1 Street Renaming Saga by Amir Dotan
History of Stoke Newington
 
Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...
Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...
Blind Spots in AI and Formulation Science Knowledge Pyramid (Updated Perspect...
Ajaz Hussain
 
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptxFESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
DanmarieMuli1
 

Editor's Notes

  • #3: Hello! I’m a front end engineer, and I work for Clearleft! We do information architecture, user experience design, and usability testing and as part of all of this, we often provide our clients with the HTML and CSS that implements our designs, and that’s what I focus on. At Clearleft, we strive to produce ...
  • #4: ... high quality client-side code, which for us means ...
  • #5: ... beautiful and valid markup, we delight in finding the perfect element for every context we are perfectionists ... http://www.flickr.com/photos/21984953@N00/38992864/
  • #6: ... we use meaningful markup and class names, and avoid polluting our code with too many divs or spans this keeps things lean, mean and fast loading ... http://www.flickr.com/photos/24839392@N00/2396027766/
  • #7: ... Unlike this apple here, we ensure that our sites are “bulletproof” This means that the design holds together despite varying content, for example user generated content or anything that is being spat out from a content management system Our sites also work when the browser is resized or the user changes their font size ... http://www.flickr.com/photos/nebarnix/337062435/
  • #8: ... we embrace the trifle of the web, Now I don’t actually like trifle very much, but it does make a nice analogy for client-side web development we separate our content and behaviour from presentation, this means our sites are still accessible even when CSS or JavaScript is disabled ... (for a detailed and beautiful description of the ‘trifle of the web’, please see page 6 of Cal Henderson’s “Building Scaleable websites”) btw yes I know this is not a photo of a proper trifle. http://www.flickr.com/photos/83096974@N00/466881574/
  • #9: ... we then have to hand over our markup and CSS to external developers to integrate with their back-end code and for the client to maintain in the long term. and we have to do all of this ...
  • #10: ... on agency deadlines, this normally works out at about 2 or 3 weeks to build the client-side code for a brand new site ...
  • #11: ... Every presentation needs some boxes and arrows. But don’t be mislead by the diagram, I’m not just a cog in a machine. I get to spend all day making things! ...
  • #12: ... I take designs from our very talented design team and turn them into front-end codeTo give you an example of the range of designs I’ve been implementing recently, here are a few screenshots of ones that are not currently under NDA ...
  • #13: ... RateMyArea was the first site I helped with at Clearleft, nearly a year and a half ago now ...
  • #14: ... UX London is a conference we're running in June. This is the first site we've implemented using ideas and a doctype from HTML 5 ...
  • #15: ... as a web design agency, naturally the hardest site to build was our own. This took at least a year of arguments, many many designs and about five iterations of the front-end code! ...
  • #16: ... Tourdust was the first site we built using an agile methodology with an external server-side development team. This made maintainability and implementation flexibility even more important than usual ...
  • #17: ... and this is what I should have been working on when I was writing this talk! As a lover of cute pictures of tigers, it’s great to have some content I can get my TEETH in to! ... Ho Ho!
  • #18: So what do I need to get started? Well, obviously I need the design...
  • #19: ... Our designers mostly work in Fireworks, so generally I get handed a Fireworks file with the different pages as layer groups. But the design alone isn't enough
  • #20: ... I also need to have some conversations, both with the designer and any server side developers, before I can start planning how I’m going to build the site. ...
  • #21: ... we’ll talk about liquid, elastic and fixed a bit later on. What’s the minimum content scenario? By that, I mean what happens when things aren’t there - for example, a news story that normally has an image but sometimes has to display neatly without one, or a listing page that sometimes has no items Will there be themed sections? For example, do news pages have a different header or colour scheme than product listings How should we deal with text wrapping e.g. in the navigation? This is especially important for tabs and horizontal navigation. Text wrapping around images is another common query. Depending on the nature of the design and the budget, we might opt to use progressive enrichment for some design elements. This means that standards compliant browsers are rewarded with little bits of visual flair which shouldn't be missed by unfortunate ludites stuck with IE ...
  • #22: ... conversations I'll need to have with the developer include if a CMS will be used to manage content. In my experience projects with a CMS involve giving up full control over the resulting markup. If internationalisation is a requirement, it’s best to avoid using images with text in them as they make translation much harder. Languages such as German can have translations that are much longer than the original English, as such things are more likely to wrap. Languages such as Arabic are particularly trick to support, as they require both the text and the design to flow from right to left instead of from left to right. The browser support for this can be a little shaky, so supporting these languages will add quite a bit of time to the estimate. How the themes are to be managed is something else to think about, will I be controlling this with a class on the body or does the CSS need to be generated All these conversations lead into the doctype decision. I'm not going to enter this minefield of a debate right now (other than to say that given the choice I prefer HTML 4 strict), feel free to grab me about this later ...
  • #23: ... as I mentioned earlier, this is a decision that has to be made right at the start. Not everyone browses the web at the default font size, or with a standard sized browser window. Why not make your site look like it was designed with them in mind? In CSS it’s possible to define dimensions in terms of a percentage of the overall browser window, or alternatively as a multiple of the size of the font. Either of these techniques can be used to create what’s known as a flexible layout. I feel that flexible layouts are a way of breathing life in to a static design, and adapting it to the flexible nature of the web Regardless of the decision you make here, it’s important to resize your browser window and increase and decrease your font size during development to see how this affects the page...
  • #24: ... in a liquid design, the layout adjusts based on the browser width. This is achieved by specifying dimensions in percentages ...
  • #26: ... an elastic layout changes as the font size is increased or decreased. This can be done by setting dimensions using ems, a measurement which is tied to the font size. The key advantage of elastic is that the number of words on a line stays roughly the same, allowing for the optimum readability length of 75-100 characters per line to remain ... I'd you a video for fixed, but you would’t be able to tell it from a screenshot! ...
  • #28: Be afraid of setting heights on anything, especially when it contains text. Text is liable to spill out or overlap other elements on the page if the font size is increased or more text is added. Vertigo is healthy on the web ...
  • #29: ... If you want to know more about implementing flexible layouts, I can recommend this book which came out just a couple of months ago ...
  • #30: Just as you wouldn't consider making a house without a proper plan, I like to spend some quality time with pen and paper before writing a single line of code ... http://www.flickr.com/photos/23762528@N04/3000454012/
  • #31: By the end of the planning stage I want to feel comfortable with how I am going to tackle the build
  • #32: ... If I come across something in the design that doesn't have an obvious best solution, I like to create a separate HTML prototype. This is my way of proving that something is possible to build in a robust manner. Quite often I will roll these prototypes in to the final build. Sometimes if I tell Paul, our designer that something is not possible he'll prototype it himself to prove otherwise ...
  • #33: ... now, looking at the site as a whole, we need to identify the page structure, as well as common components....
  • #34: ... for example, identify areas, such as the ...
  • #35: ... header ...
  • #36: ... primary content ...
  • #37: ... secondary content ...
  • #38: ... individual content components such as the teaser on this page we'll talk about common components in more detail later, as they are key to creating reusable code ...
  • #39: ... A lot of modern web design is based around a grid. it ensures elements are aligned with each other, and gives the site a nice consistent visual feel this needs ... http://www.subtraction.com/2004/12/31/grid-computi
  • #40: ... this needs diagrams ... http://flickr.com/photos/adactio/1799116343/
  • #41: ... lots of diagrams, it basically boils down to proportions, analyse the site as a whole, look at content areas and see how they interact with each other and align to the basic grid ...
  • #42: ... the grid will normally have some dependancy on the base font size, ask your pet designer if you are not sure. you will need to make some initial calculations before you come up with the precise proportions I’m pretty hopeless at maths so for me this also involves yet more diagrams Don’t be too exact though, IE isn’t very good at counting, and will fall victim to rounding errors ...
  • #43: ... If you figure out your heading levels from the start this will help decisions later on. This seems like a subtle point, but properly designed heading levels are an excellent start for coming up with a sensible overall structure for your site ...
  • #44: ... to avoid making more work for yourself, it’s best to identify the typographical hierarchy for the overall site as early as possible ...
  • #45: Next I'm going to share with you some of my favourite tools of the trade ... http://www.flickr.com/photos/7881731@N06/2639919440/
  • #46: ... some sort of version control is invaluable, especially when working with a team. We use Subversion, with the long awaited and beautiful Mac application Versions. Most of our designs are now done in Fireworks, so I have a copy for slicing up images and otherwise interpreting the design. TextMate is my editor of choice, and I also use ColourSchemerStudio and CSSEdit ...
  • #47: ... I use ColorSchemer Studio to pick colours off the design - this means I can store colours from the design for future reference, especially useful for theming ...
  • #48: ... CSSEdit is a development tool for the mac, which I absolutely love. It only edits CSS, but it does it so well that I don’t mind having an extra tool. Grouping is by far my favourite feature. you can see here on the left hand side it has displayed my nested groups which I use as a navigation aid to traverse the CSS on the right There are Windows alternatives available; anything with code folding is worth a look ... http://macrabbit.com/cssedit
  • #49: ... Firefox is my main development browser, mainly because of the extensions. Firebug is absolutely invaluable - if you ever have to touch front-end code and you don’t have this installed, look it up. The HTML Validator extension is incredibly hard to track down, since they don’t update the version on the Firefox addons site. It adds a green “tick” at the bottom right of the browser, and is a constant illustration of whether my code is valid. Operator is how I test my microformats. YSlow is an extension for an extension! It adds a new pane to Firebug highlighting potential performance problems in the front end code.
  • #50: ... topographic view in the Web developer toolbar is useful for exposing the bare bones of your site. Let&#x2019;s turn it on ... <ACTIVATE>
  • #51: ... here for example you can immediately see that the container on the lower half of the page is not clearing around its two internal floated elements ...
  • #52: We follow our own version of Yahoo!&#x2019;s graded browser support guidelines, which define which browsers should be tested for the full experience, which browsers should at least make the content accessible and which can be safely ignored. You&#x2019;ll be glad to hear that we don&#x2019;t code for Netscape 4 any more! I use VMWare Fusion to run different versions of Windows on my Mac, which lets me safely run more than one version of IE at a time. As a general rule, I test constantly throughout development in Firefox, Opera, Safari and IE 6 and 7. I double check other browsers such as Camino and Safari on Windows towards teh end of the development cycle.
  • #53: ... I&#x2019;ve been working with CSS for a long time, and I&#x2019;ve attempted to distil some of that knowledge in to some heuristics, or rules of thumb. Ten would be a nicer number since we all have ten fingers, but I have eight - so maybe these should be ... http://www.flickr.com/photos/95141439@N00/357358126/
  • #54: ... 8 CSS rules of ...
  • #55: ... finger instead ...
  • #56: ... if you only take away one rule, make sure it&#x2019;s this one. It&#x2019;s key to developing the correct mindset. If you think about pages first, you&#x2019;ll find yourself duplicating large amounts of CSS code. Every time you need to create a new page you&#x2019;ll have to start mostly from scratch. Instead, think about the reusable components that make up the design. Create a core set of components that can mixed together to create hundreds of different page combinations ...
  • #57: ... look for opportunities to classify similar content elements together ...
  • #58: ... which leads us nicely to rule 3: prefer CSS class selectors to IDs. Rules assigned to a class (or type of thing) are reusable. By definition, ID blocks can only apply to a single element on a page. Classes are the only way to build reusable components.
  • #59: ... another advantage of classes is that you can apply more than one class to an element. Just as permutations of components can create many different types of page, permutations of classes that have been designed to be composable can create many different types of component for example, one class could define the layout properties of an element while another class applies its theme and colour scheme. This allows for more possible combinations without needing to add more code ...
  • #60: ... you don&#x2019;t need to get carried away and classes to everything though ...
  • #61: ... so here we have a news item, and the h2 has a class of news-heading. Say we wanted to set a colour on the heading. Weasel isn't actually a colour in the spec, but Simon insists it should be...
  • #62: ... A more efficient way of achieving the same effect is to take advantage of the context of this h2 ...
  • #63: If your selectors are too long, you are tightly coupling your CSS to your markup You can't move things around, because the selector binds the rules to an exact point in the markup hierarchy. This reduces its reusability. Shorter selectors are also easier to over-ride.
  • #64: If you&#x2019;re keeping your selectors short, it's more important to understand the cascade, in particular the way CSS rules over-ride earlier rules with the same specificity. Following a sensible convention also makes it easier to find things and understand how the code works...
  • #65: ... if you&#x2019;re doing a flexible layout it&#x2019;s a lot easier to deal with changing designs if the internal dimensions are set in percentages. Changing the outer container&#x2019;s width will cause everything inside it to re-adjust...
  • #66: ... here's a planning artifact that illustrates internal widths set in percentages. It's an elastic site, so the overall width is set in ems. Also, I've added a max-width of 100% to make sure that you never end up with a horizontal scrollbar (or crawlbar) even if the user makes their text huge. This is a handy trick for making elastic designs more robust. ...
  • #68: ... for things like font ...
  • #69: ... margins or background. I don't. necessarily. Longhand can often be preferable, particularly with background. firstly it makes debugging in firebug easier, you can see where overrides are effective. you will also have similar issues as the &#x2018;one ruleblock per line&#x2019; when it comes to source control. you can tell that a line has changed but its not imediately obvious which part of that line. but mainly and this is more noticable with backgrounds ...
  • #70: ... that by using shorthand its easy to override declarations without meaning to. For Example if you are using all the sections of the background like we are here, then its easy to see what this is doing, but if on an element you have already specified it as ...
  • #71: ... having a delightful lime green background, and you then you want to have a variation of that inherit the lime styles but also have a transparent background image ...
  • #72: ... rofl.gif if you specify it using just the background declaration, then this overwrites the lovely lime green colour one solution of course is to specify the colour here too, but then &#x2018;lime&#x2019; is in two places, you are not taking advantage of inheritance within declarations, and what if you suddenly want to change to pink, now you have to change it in two places, this is not optimal also always bear in mind that people editing your code are likely to be copy and pasting from the rest of the file, so you have to set a good example with this throughout your code. so a better solution would be ...
  • #73: ... use the longhand version, and override with subsequent longhand versions ...
  • #74: So these are my rules of thumb. I'll be making the list of rules available later on natbat.net.
  • #75: a.k.a. dealing with the inevitable decent in to browser bug hell http://www.flickr.com/photos/jurvetson/17945646/
  • #77: I&#x2019;m giving away the answer to a good interview question here. Could it be a hasLayout bug?
  • #78: As Noel Edmonds will apparently tell you in his best selling self help guide, a Positive Mental Attitude is essential in dealing with IE.
  • #79: ... the alternative is to sell your soul to unspeakable demons from alternative dimensions. They don&#x2019;t like IE very much either. ... http://images.google.com/imgres?imgurl=http://www.thecimmerian.com/wp-content/uploads//2009/02/cthulhu-6.jpg&imgrefurl=http://www.thecimmerian.com/%3Fcat%3D30&usg=__1_3xzSSQ0vRKSiae37BhSy2KKeE=&h=405&w=540&sz=45&hl=en&start=1&um=1&tbnid=vBgWGVpq9eIEiM:&tbnh=99&tbnw=132&prev=/images%3Fq%3Dcthulhu%26um%3D1%26hl%3Den%26client%3Dsafari%26rls%3Den-us%26sa%3DN
  • #80: ... don&#x2019;t worry, they&#x2019;re not as scary as they first seem! In case you&#x2019;re wondering, that&#x2019;s me dressed as a pumpkin. code reviews should be an essential part of your development process. If you can explain your CSS to someone else and have them understand it, there&#x2019;s a pretty good chance what you have done is robust and maintainable. ...