Author Archives: CSS Guy

Use of aria-describedby with form elements that have descriptor text

If form fields have formatting help or descriptor information for the input, such as “Passwords must be 8 characters long”, one cannot assume that screen readers are reading that input by default. <label for=”choosePassword”>Choose Password:</label> <input id=”choosePassword”> <span class=”help”>Passwords must … Continue reading

Getting around the flicker of JavaScript modifying the DOM while the page is loading

When building things with progressive enhancement, I often want the page styled a certain way when JavaScript is on vs off. When you use $(document).ready() in order to modify your page, you may end up watching the page modify before … Continue reading

CSS gradients and background images

Let’s say you have a web page with a solid pale blue background color with a background image positioned on top of it. body { background: #a5c9e5 url(img.png) no-repeat 50% 300px; } And this is the result: See example 1 … Continue reading

Nudging elements with position: relative

I find that most people are familiar with using position: relative; on a containing element so that its descendent can be absolutely positioned relative to that element. So to get this effect: The positioning rules would look something like this: … Continue reading

Waqas asks the CSS Guy how to specify an alternate font size if the preferred font isn’t available on the user’s system

Waqas writes: Is there any way to specify alternate font size? e.g. p { font: 11px Tahoma, Helvetica; } If Tahoma font is not available in machine, Helvetica will be used (if available) with size 11px. Is there any workaround … Continue reading

Memphis AIGA Mini-conference

This saturday morning, October 16th, there is a local AIGA mini-conference on topics like designing for mobile, HTML5 and CSS3 (yours truly speaking), HTML frameworks, accessibility, and more. If you’re in the Memphis area, check it out. Here are the … Continue reading

Spinboxes Optimized for Touchscreen

So what’s a spinbox? A picture is worth a thousand words: Here’s the thousand word version (via): A spin box — sometimes called a spinner control — is a collective term for the combination of a text box with an … Continue reading

Review of CSS Mastery, Second Edition

I don’t read many technical books about web site development with CSS. I probably learned like many of you likely did: online articles, right click/view source, firebug, and a hell of a lot of trial and error. I never take … Continue reading

Monetizing your code

I’ve toyed with offering affiliate links to Theme Forest from this site in the past. But since the people who typically visit my site tend to design and markup their own, it didn’t seem worth it (and the click-through numbers … Continue reading

A way we could potentially get around the fact that many web forms prevent plus signs in email addresses

Many of you are likely already familiar with the immensely useful feature of including plus signs (+) in Gmail addresses, such as the following: askthecssguy+mileycyrusfanclub@gmail.com This would allow me to sign up for account at another web site, and be … Continue reading