Internal Server Error

what the voices in my head tell me to write

Tuesday, August 16, 2005

Some times you just have to do things backwards to do them right 

I have been struggling with the font-size switcher on Ingentaconnect for ages. A year on and off.

I was assigned a bug that basically said "If you turn off javascript the font-size is smaller and some layout breaks." When I looked at the CSS in that light I suddenly realised that I had been assigning <body> a pixel font size in the default style sheet and then using ems to resize various bits in the switched in css files.

This meant that the switched in files were pretty huge as I had to account for lots of little divs etc and if I had a <li> nested within a <div> it would do the sizing twice unless I added in an inherit rule. Of course this was a very hard to maintain mess.

Now the switcher files simply change the font-size for <body> and another CSS file is defining the sizes in ems for <h1>, <h2> etc. (Of course there is a little hack for IE not getting sizes right) Its about a 95% reduction in the ammount of CSS and far easier to work with.

Permanent link and Comments posted by Rob Cornelius @ Tuesday, August 16, 2005

Comments: Post a Comment

Links to this post:

Create a Link

links to this post
    follow me on Twitter

    My recent photos


    Creative Commons License
    This work is licensed under a Creative Commons License.

    RSS feeds and things

    Feed Button Help

    This page is powered by Blogger. Isn't yours?

    contact the author

    rob cornelius can be contacted by email use his name with an dot and googles web based email domain