Archive for the 'CSS' Category

Page 2 of 3

Simple Relative Font Size Equation

For those of you working with relative font-sizes in your CSS, here is a basic equation for getting the exact size equivalent in ems, given a desired px value:

emr = pxt ÷ pxp, where
 
emr = result font size, in ems;
pxt = target font size, in px;
pxp = parent element’s font size, in px;

Continue reading ‘Simple Relative Font Size Equation’

Forming Effective CSS Classes & IDs

If you’ve ever had trouble establishing a naming standard for your CSS classes, or if you work closely with a developer who demands uniformity when assigning IDs elements, here are some conventions (as well as some of my personal preferences on usage) that should help you form effective, easy-to-remember and predictable names.

Continue reading ‘Forming Effective CSS Classes & IDs’

(There Is Hardship) Beyond Arial & Verdana

Over the course of several recent projects, I’ve been experimenting with some alternatives to the usual cast of web fonts (Arial, Verdana, Georgia, etc.). I know this is nothing new, as countless other designers have had other fonts grace their designs. While the results of my experiments often prove less than successful, I proceed to share my experiences in pursuit of documenting web font knowledge. After all, what’s a designer’s job without a little challenge every now and then?

For those living in the comfort of Arial & Co., do not take this as a discouragement from exploring the outer limits of web fonts, but as a warning of what lies ahead.

Continue reading ‘(There Is Hardship) Beyond Arial & Verdana’

An Even Better IE Button Width Fix

Last time around, I went about writing an article documenting a revision for Jehiah’s IE Button Width Fix that would allow it to behave correctly, given a proper DOCTYPE. It worked well, with a minor downside that it required the use of IE conditional statements in your HTML to dish out the fix to just Internet Explorer browsers.

Just recently, Peter replied to that article, proposing an alternative solution that did away with conditional statements. This would mean that you could include the CSS fix in your main stylesheet (and not in the HTML with the conditional comment, or in a separate stylesheet for just IE fixes).

Continue reading ‘An Even Better IE Button Width Fix’

Maximize CSS Comment Usage

I’ve been working on a couple of CSS layouts in the past few weeks and really got into using comments full blast. I also found some more interesting uses for CSS comments, aside from the usual authoring information and section markers. Most of you are probably doing these already, but I wanted to share them, anyway.

Continue reading ‘Maximize CSS Comment Usage’