From the Journal
Thank You Alan Turing
June 23rd will mark the 100th anniversary of the life of famous English mathematician Alan Turing.
On every site, from personal e-commerce to blogs, style sheets can simplify changes, and make pages more accessible.
As customers visit your website, you can learn something about what they like and what they don’t like in terms of content and look and feel. You can also learn what works and what doesn’t work in terms of navigation. You might glean this feedback from informal conversations with customers, from server logs indicating that people don’t click on certain links, or from more formal usability and market research. But once you have some information about what could be improved, fixing it on your site can be daunting unless you’ve planned ahead.
If you’ve got design problems to fix on all your pages, it will be hard to justify the changes if you have to edit every single page. It takes time to open, edit, and save every file back to the server; then test every file, and possible open and edit it again if there continues to be problems.
You can avoid the problem of mixed content and presentation and make it easy to modify the presentation of all of your web pages by using cascading style sheets (CSS). Although it’s not difficult to make changes to HTML pages without CSS, it will often become problematic if you need to change whole sections of a page or several pages at once.
With CSS, you specify all of your content in the standard HTML files, and specify how that content should be presented in a CSS file.
Below is an example of what I mean.
HTML:
Some content would go here.
Only the content is specified in this HTML file. All the style information is contained in a separate style sheet (style.css).
CSS (style.css):
h2 {
text-align: left;
color: #333;
font-family: Georgia, "Times New Roman", serif;
font-style: italic;
font-size: 18px;
}
p {
text-align: left;
color: #777;
font-family: Verdana, Arial, sans-serif;
font-style: normal;
font-size: 11px;
}
With a CSS file like this it would be possible to make whole sitewide changes to the style of the
and
tags on every page of the site with the update of only one file.
Style sheets can be used as part of your page templates to create flexible and attractive web pages. You might define one default style sheet that all of your pages will use — one that defines the basic look and feel or your site.
Things that can benefit from the use of style sheets include
Flexible grid layouts
Navigation bars
Tab rows
And text links
It is a good idea to have a separate style sheet for creating printable pages. This style sheet can be a much simpler version of your page template style sheet because printed web pages will not display navigation elements such as tabs and navigation bars, extra content modules, such as the sidebar or external links, or advertising.
To establish a specific print style sheet you’ll need to define the following just below the default style sheet in the HTML file.
This will ensure that the printing functions will use the styles defined in the print.css file instead of the default style sheet. The technique can be very useful when creating ‘newspaper’ style articles that you intend for your visitors to print for future reference.
If you intend on having your content viewable by mobile phone users, then it’s a good idea to setup a separate mobile style sheet for them. This ensures that your content and web site represent the best possible image they can to your viewers. Someone would hate to navigate to your site only to find out that you haven’t taken the time to design an experience around the way they like to browse your site. It might make them feel like they are less important. This is just not the case anymore with more and more users beginning to really use their smart phones for things like browsing news sites and even purchasing products online. Sites like Amazon and Google have jumped on this trend and it can only be assumed that more and more companies will join in.
Here’s an example of how you might define a mobile style sheet:
For more information about creating mobile CSS, go to w3.org/TR/css-mobile
A List Apart is also a great resource for articles on the topic of CSS.
Ghost - Square Hammer
Michael Kiwanuka - Love & Hate
Michael Kiwanuka - One And Only
Michael Kiwanuka - One More Night
Michael Kiwanuka - Home Again
© 2014 Pixelhaven Terms of Use | Privacy | Contact