Mantex

Tutorials, Study Guides & More

  • HOME
  • REVIEWS
  • TUTORIALS
  • HOW-TO
  • CONTACT
>> Home / Archives for Cascading style sheets

Cascading Style Sheets

July 4, 2009 by Roy Johnson

explanation – by the guys who invented them

What are cascading style sheets (CSS)? Answer – “a simple mechanism for adding style (fonts, colors, spacing) to Web documents”. If you have spent any time at all wrestling with HTML code, trying to control the layout and appearance of text on a page, you will know one thing. It’s an almost hopeless task. What looks good in Netscape might be a dog’s breakfast in Internet Explorer, and it will probably look even worse in Opera. The same would be true of more recent browsers such as FireFox and Google Chrome.

Cascading Style SheetsAs Lie and Bos explain: “HTML doesn’t pay much attention to the document’s appearance” – so CSS offers “a simple language that can be read by humans”. It’s basically another system of coding which can be added to .htm pages which allows the author more control over the physical appearance of what’s on the page. It also begins the process of separating appearance from content. They start with an introduction to basic HTML (which they claim can be learned in less than a day!) before describing CSS in all its detail. This is where any normal user will encounter the first difficulty – because the code is defined in a relentlessly arbitrary jargon – of ‘selectors’, ‘declarations’, ‘properties’, and ‘values’.

Then they go on to describe the variety of ways in with a style sheet can be ‘glued’ to a document. This fortunately offers the user more than one way to achieve a particular effect. But there’s no escape from the abstract style:

Recall from Chapter 1 that an attribute is a characteristic quality, other than the type or content of an element. In that chapter we discussed the attributes HREF, SRC, and ALT. In this chapter we will discuss two new attributes that have been added to all HTML elements to support style sheets

But what it lacks in accessibility, it makes up for in thoroughness, and fortunately, the book is very well illustrated. They cover all the features of this mini-technology which Web designers are likely to require – fonts, spacing, layers, colours, and the tricky issue of forward compatibility. They describe the issues of cascading and inheritance which advanced users might wish to exploit. I would have liked to see the page code for some of the wonderful examples they reproduce in full colour, but at least they show what CSS can do.

Style sheets may well become more popular as the early generations of browsers which didn’t support them fade into the ancient history of the Web [that is, anything more than five years old]. If you’re interested in exploring the possibilities of CSS, then you might as well get the story from the guys who invented the idea – and make sure you buy the latest (third) edition, which contains a useful comparison of browser-support. As the HTML standard is developed to keep pace with browsers in their latest versions, this is a book with a bright future.

© Roy Johnson 2005

Buy the book at Amazon UK

Buy the book at Amazon US


Hakon Lie and Bert Bos, Cascading Style Sheets: Designing for the Web, New York/London: Addison-Wesley, (third edition) 2005, pp.416, ISBN 0321193121


More on technology
More on digital media
More on online learning
More on computers


Filed Under: HTML-XML-CSS Tagged With: Cascading style sheets, CSS, HTML-XML-CSS, Web design

Cascading Style Sheets

July 9, 2009 by Roy Johnson

complete explanation of style sheets for web designers

This is the second edition of Eric Meyer’s best-selling guide to cascading style sheets. It covers CSS1 in impressive depth, and cautions readers quite frankly about some the problems of the still immature CSS2. Style sheets are the solution to the one big limitation of HTML. They allow authors to control the appearance of what’s on the page, leaving the HTML code to describe the content and its structure – which was its purpose in the first place.

Cascading Style Sheets The original guide to CSS, Cascading Style Sheets, produced by its inventors Hakon Lie and Bert Bos, is thorough and well illustrated, but it’s written in a very dry manner. Eric Meyer manages to make his account more readable, and more easily digestible for those who will need it. His ‘definitive guide’ is organised in logical sections which discuss what can be done with fonts, colour, the appearance of text, and layers – which is the introduction of a third dimension to what appears on screen.

He explains the many ways of creating colour – with a humane description of the mind-bending hexadecimal system. Then he deals with the complications of length units, the arrangement of text on the page (using spacing, justification, decoration, and alignment) and the way in which fonts and the appearance of text can be controlled.

He goes into a lot of detail on the manner in which fonts are rendered – their family, size, weight, attributes. The same is true on backgrounds. It’s a pity that O’Reilly have decided to limit the book illustrations to white, grey and black – because the topic is crying out for colour illustration.

Sometimes there are extended descriptions of what CSS tags will do, when an illustration would have been more useful, but he explains which elements are ‘deprecated’ – that is, ‘in the process of being phased out’ from the HTML Specification.

CSS also allows authors to get ready for the eventual move from HTML to extensible markup language (XML) so it’s worth learning about style sheets if the current enthusiasm for XML is going to last. There are some amazingly complex effects described which involve background images and negative positioning – pushing graphics off the screen.

You have to be prepared to embrace another set of jargon – declarations, elements, selectors, properties, pseudo-elements, values, specificity, and inheritance – but no doubt these terms will become familiar.

There are also three useful appendices – an annotated list of resources, a complete list of CSS1 and CCS2.0 properties, a sample style sheet, and a list of browser support. O’Reilly have occasionally been criticised for calling so many of their manuals ‘the definitive guide’ – but in this case there’s a good case to say the title is fully justified.

© Roy Johnson 2006

Buy the book at Amazon UK

Buy the book at Amazon US


Eric A. Meyer, Cascading Style Sheets: The Definitive Guide, Sebastopol, CA: O’Reilly, third edition, 2006, pp.518, ISBN 0596527330


More on technology
More on digital media
More on web design
More on computers


Filed Under: HTML-XML-CSS Tagged With: Cascading style sheets, CSS, HTML-XML-CSS, Web design

Get in touch

info@mantex.co.uk

Content © Mantex 2016
  • About Us
  • Advertising
  • Clients
  • Contact
  • FAQ
  • Links
  • Services
  • Reviews
  • Sitemap
  • T & C’s
  • Testimonials
  • Privacy

Copyright © 2025 · Mantex

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in