Over the next month or so I’ll be releasing a few “preview releases” of the next version of TodoPaper. These releases will be working drafts of the TodoPaper 2.0 application, allowing you, the user, to test and try out the new features and refinements I’ve been working on.
When developing the HTML for websites, I (and many other web workers) often run into the problem of adding page specific styles to the project. These types of styles are very useful. Say, for example, you are building a blog and have two pages which use a generic and reusable “article” container which wraps a blog post. The first page is a full article listing with many of these article containers on the page and the other is an individual post page, which only has one post. If you wanted to style these generic, reusable containers differently in each page, you’d need page specific styles.
There are three solutions to this problem:
- Use embedded styles
- Use page specific style includes
- Use page id or class selectors
Use embedded styles
The first solution to this problem is to embed page specific styles directly in the html elements. I present this solution first, as it is the worst of the three. Every developer reading this right now should be cringing.
Use page specific style includes
The second, more natural solution to this problem is to create separate stylesheets for each page.
Use page id or class selectors
The final, and my favorite solution, is to use a page id or class to identify the page, which can then be used in CSS selectors to style the element based on the page.
Writing software is a lot like writing prose. Goals: be legible, clear, and succinct.
from merlin mann’s presentation:
work for it
set aside time
just do it
get off your ass, stop reading about how to do something, and just do it
In his book, On Writing, Stephen King tells a brief story about receiving a scribbled note from an editor. The note described his work being “Not bad, but PUFFY”. The editor then jotted down this formula:
2nd Draft = 1st Draft – 10%