The BBC website is one of the most popular destinations on the Web. It has a page rank of 9 and a reputation for quality reporting and resources.
Internally, the BBC also has some of the strictest guidelines known to web developers. It’s not just browser issues either — every aspect of technical development has a set of published rules.
I’ve been studying the recently-updated CSS Standards. They’re all best-practice techniques but they go further than many company policies!
General CSS Principles
Most browsers (or extensions such as the Web Developer Toolbar) allow you to disable CSS and scripting. If the content isn’t readable, you can guarantee that Google and screen readers can’t see it either.
According to the guidelines, all CSS must be valid according to a published W3C recommendation. I suspect that causes a few headaches as it appears to rule-out vendor-prefixed properties such as
-webkit-box-shadow. However, the BBC site does use them sparingly.
!important is banned because it overrides user styles. That’s a little harsh since it can be useful for IE6 fixes. That said, I’ve been guilty of abusing it for quick and dirty hacks when I should have addressed the root of the cascading problem.
Finally, if you’ve abandoned IE6, spare a thought for the BBC coders still testing in IE5.5! CSS is particularly nasty in that browser: it tries to parse the properties but fails dismally.
All CSS is implemented in compressed external stylesheet, although CSS in the HTML
head is permitted when a rule is required for a specific page.
Inline styles are banned. That’s good. Any coder found using them should have their web development license revoked!
Interestingly, external CSS files must not be loaded using
@import because it impairs browser caching. Does it? I doubt that’s still the case in modern browsers.
Typography and Color
A single generic font name of serif, sans-serif, cursive, or monospace must be added to the end of all
font-family properties. Again, this is something developers often forget: not everyone has Arial or Helvetica on their PC.
I loved the double-negative rule:
Typographic sizes MUST NOT be specified in units that are not resizable in all browsers such as px and pt, except for in print stylesheets.
The BBC recommends either em, % or keyword values and text must remain readable when the size in increased by two steps in any level 1 browser. I bet that’s a testing nightmare!
Finally, developers must define a page background color. I’ve had that rule tattooed to my forehead after viewing one of my sites on a PC where the default had been set to a sickly green.
Developer Heaven or Hell?
If you’ve been working in the industry for a while, you have probably absorbed many of the guidelines laid down by the BBC. But how do newer developers cope? On the positive side, the expectations are well documented and it helps coders avoid basic usability mistakes. However, development is tough enough — most people would struggle to contend with multiple rules and regulations defined for 24 inter-related technologies.
Does your company enforce strict coding guidelines? Are they set in stone or reasonably flexible? Are they sensible or ridiculous? Are they updated regularly or are you still coding for Netscape 3.0? Do guidelines help or hinder your day-to-day development tasks?
I’d also be interested to hear from any developers at the BBC … do you follow the rules to the letter or have you sneaked in the odd !important when your manager’s not looking?
Using Redis with Node.js
By Ivaylo Gerchev,
Need fast data interactions in your Node app? Learn how Redis speeds caching, message brokering, sessions, analytics, streaming and more.
Build a Website with React and Tailwind CSS
By Shahed Nasser,
React and Tailwind CSS: a beautiful relationship! Learn how Tailwind frees you from writing CSS so you can focus on your React components.
React Fragments: A Simple Syntax to Improve Performance
By Antonello Zanini,
React fragments provide a simple syntax to group a list of HTML elements without adding unnecessary nodes to the DOM. Here's how.
Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's created enterprise specifications, websites and online applications for companies and organisations including the UK Parliament, the European Parliament, the Department of Energy & Climate Change, Microsoft, and more. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler.