Grow your CSS skills. Land your dream job.

Article Archives

CSS Day 2013 Talks

Gotta love it when conferences post all the talks online. Perfect for some weekend binge watchin'.…

July 20, 2013

How Web Tech Concerns Change

As a beginner in any specific web tech, your first concern is "what is this and how does it work?" As you level up, those concerns change. You may still learn about about how it works as you dive deeper, …

July 18, 201329 comments

New Poll: Does Offscreen / Drawer Nav Work for Desktop Too?

A reader wrote in with this question:

We know that slide out menus are good for mobile (Facebook, Gmail, etc) But do you think they are appropriate for desktop web applications?

Good question. You know the type:

Certainly we can …

July 16, 201348 comments

Poll Results: Light-on-Dark is Preferred

This poll asked people if they like their code editor colors "dark code on light background" or "light code on dark background." Turns out about 2/3 of people prefer light code on dark background.

For the first several days after …

July 15, 201339 comments

Sass + Dev Tools Workflow

There have been a couple of good articles lately on improving the Sass/CSS workflow by using 1) Source Maps so Chrome knows what's up with your Sass files and partials 2) Telling Dev Tools to save changes back to disk …

July 11, 2013

Easier Aspect Ratio Elements

Nice writeup by Marc Hinse. It's similar to Uncle Dave's Ol' Padded Box, except the percentage padding-bottom is moved to a pseudo element where it doesn't need to be adjusted when the width value changes.…

July 11, 2013

If Kerouac wrote JavaScript

When I opened Johnson’s completed assignment, I found a short note from the good doctor, explaining why he had chosen to use CoffeeScript: “Sir, the funcktion key-word is an ALBATROSS and the curly brace is worthless FILIGREE. I desire a …

July 10, 2013

The Almanac is “Complete”

This is just a note to let ya'll know The Almanac section on CSS-Tricks is complete. Not complete as in totally done and never will be changed or anything foolish like that, but complete as in all CSS selectors and …

July 10, 201335 comments

Create Striped Backgrounds With Gradients (and a Sass Mixin)

Hugo Giraudel shares how to create striped backgrounds with gradients. He makes things easier with a Sass function.
July 9, 201332 comments

The Extend Concept

All three of the most popular CSS preprocessors support extend. I don't have any data, but in my experience this feature is confusing at first and thus a bit under used. I thought we could talk a bit about …

July 8, 201338 comments

The Sixth Fourth

It's a tradition around here to do a State of the Union post on the Fourth of July. This is the sixth one! (1) (2) (3) (4) (5).

Obligatory fireworks stock art:

I type this from Milwaukee, Wisconsin - …

July 4, 201317 comments

Centering Percentage Width/Height Elements

If you know the exact width/height of an element, you can center it smack dab in the middle of its parent element easily with this classic trick: top and left set to 50% and negative margins half the width …

July 3, 201373 comments

Swapping Out Text, Five Different Ways

It's a common need in web apps: you click something and the text of the thing you just clicked changes. Perhaps something simple like a "Show" button that swaps to "Hide", or "Expand Description" to "Collapse Description." This is a …

July 2, 201349 comments

Hoefler & Frere-Jones Web Fonts

Are here! I've been using them quite a while here on CSS-Tricks and I'm a big fan.…

July 1, 2013

An Intro to Hitch.js and the Extensible Web

Brian Kardell explains how Hitch.js allows you to build "prollyfills," and how Hitch.js fits into the larget Extensible Web movement.
July 1, 201315 comments

Mobile Web Problems and How to Avoid Them

Lessons learned from two years of collecting screenshots of poor experiences on mobile websites.…

June 27, 2013

GoodUI

16 good fundamental ideas by Jakub Linowski.…

June 27, 2013

The Layered Look: Better Responsive Images Using Multiple Backgrounds

A guest post by Parker Bennett where he explores another responsive images technique. This time using media queries and multiple background images in CSS.
June 26, 201332 comments

Making Sass talk to JavaScript with JSON

The following is a guest post by Les James. Like many of us, Les has been gunning for a solution to responsive images that works for him. In this article he shares a technique he found where he can pass "named" media queries from CSS over to the JavaScript, which uses those names to swap out the image for the appropriate one for that media query. And even automate the process with Sass.
June 25, 201325 comments

Developing With Sass and Chrome DevTools

Umar Hansa walks through the setup to make sure you're getting the most out of both. It doesn't mention Chrome DevTools Autosave which I haven't tried yet either but I've heard good things.…

June 24, 2013

CSS-Tricks Chronicle XIV

I live to hail that season by gifted one foretold, when men shall live by reason, and not alone by gold.
June 24, 20134 comments

Replicating Some Of Google Hangouts Chat Design

I've been using Google Hangouts a bunch. It's really pretty great. One on one or group text chat, audio, or video. Text is archived, maintains history, and is searchable. Video / audio is recordable. It works great on desktop and …

June 19, 201336 comments

Speaker Notes

Rebecca Murphey with tips on speaking. While posted on “Ladies in Tech,” the advice is good for anyone.

I’ve learned that my ability to give the “elevator pitch” for a talk is a great measure of my preparedness.…

June 19, 2013

Intro to Web Workers

Brian Cooksey goes from "I don't really know what Web Workers are" to "OK I totally get Web Workers." on one short article.

...they are scripts that run in their own background thread. Independence from the regular JavaScript event loop …

June 19, 2013

New Poll: Light on Dark or Dark on Light?

New poll! Just for funzies. Do you prefer...

Light Code on Dark Background

Like this:

or...

Dark Code on Light Background

Like this:

Those are just examples. Doesn't have to be those exact syntax highlighting themes. But I believe all …

June 18, 2013226 comments

A Couple of Best Practices for Tablet-Friendly Design

Ben Terrill shares some things you can do to improve the experience for your visitors using tablet devices.
June 17, 201319 comments

Making Infield Form Labels Suck Less

Jackson Fox presents some of the options: slide them out of the input, slide them to the right, or move them to tooltips. All to battle the issues with in-input labels like user confusion and lack of context when focused. …

June 15, 2013

Poll Results: Mobile Web Design Responsibility

Between 2008 and 2013, people's opinion on where the majority of responsibility in mobile design lies has shifted.
June 15, 201325 comments

JSbooks

A big collection of books on JavaScript that are published free on the web.…

June 15, 2013

The JavaScript Behind Touch-Friendly Sliders

Kevin Foley explains how to build a swipeable gallery on touch devices.
June 13, 201332 comments

IE 10 Specific Styles

Conditional comments are gone in IE 10. That's good. IE 10 is a very good browser. Feature detection is a better way to go in nearly all cases. But what if you find some styling situation where you absolutely need …

June 12, 201357 comments

Hitch

It's kinda like a preprocessor (variables, prefixing...) but it can do much more because it's JavaScript that executes on your page. For instance, it can give you a has selector which can test if an element contains another element or …

June 11, 2013

Crop Top

Sometimes you want an image to resize responsively but restrict its height — cropping it then as it widens. Here, we explore three options with various trade-offs.
June 11, 201319 comments

Pizza Time Hovers

Hover Maester Jenn Lukas sent me a link to PizzaTime.com. We agreed that 1) those are some pretty neat hovers! and 2) it's pretty cool that there is a quality website at all at a domain like PizzaTime.com - …

June 10, 201332 comments

picnicc

A new tool by Alex Duloz to help create custom builds of popular libraries and frameworks. Alex made builders for Twitter Bootstrap, underscore.js, HTML5BP and inuit.css - but it can be used to create custom builds for anything. …

June 10, 2013

Request Quest

Jake Archibald put together an interesting and informative quiz about when browsers actually make requests. I learned a bunch. Some of it might seem like quirky academic knowledge but we all know how often unpredictably weird situations come up in …

June 10, 2013

The “When Can I Use” Web Widget

A script from Andi Smith that injects a chart of browser support with live data from Can I Use... I really like the idea of using it on any web tech blog post - so the information about feature support …

June 10, 2013

Build a motion activated security camera, with WebRTC, canvas and Device Orientation

John Allsop uses an old iMac and the browser to snap a picture through a web cam and then email it when it detects movement.…

June 8, 2013

Using requestAnimationFrame

There used to be just one way to do a timed loop in JavaScript: setInterval(). If you needed to repeat something pretty fast (but not as-fast-as-absolutely-possible like a for loop), you'd use that. For the purposes of animation, the …

June 8, 201319 comments

A Couple of Use Cases for Calc()

calc() is a native CSS way to do simple math right in CSS as a replacement for any length value (or pretty much any number value). It has four simple math operators: add (+), subtract (-), multiply (*), and divide …

June 5, 201335 comments

Grids with text-align: justify

Patrick Kunka demos how fluid grids can be created with percentage widths and justified text. I like it because you don't need to think about gutter calculations which is what really complicates grids. If you need specific control over gutters, …

June 3, 2013

Sass Style Guide

With more people than ever writing in Sass, it bears some consideration how we format it. CSS style guides are common, so perhaps we can extend those to cover choices unique to Sass.

Here are some ideas that I've been …

May 29, 201393 comments

3D Button Parallax

The following is a guest post by Alexander Futekov. We recently published an article by Joshua Bader in which a 3D inset look was adjusted as the page scrolled to give it a more realistic interaction. This is similar only

May 27, 201333 comments

Upping Your Type Game

The ultimate primer on web type for web developers by Jessica Hische.…

May 24, 2013

Just One of Those Weird Things About CSS: Background on <body>

So you want to make the background of your website red eh? You'll probably put this in your CSS:

body { background: red; }

Done!

Check out this Pen!

You're going about your business and then all the sudden one …

May 24, 201340 comments

This Website Brought To You By…

I always wanted to write something on all the technologies that a website relies on in order to have been created and work. My attempts have so far failed because it spirals out of control so quickly. Kevin Kelly sums …

May 24, 2013

Logic in Media Queries

Just in case you have brain farts about this constantly like I do.

If

That's what media queries are: logical if statements. "If" these things are true about the browser, use the CSS inside.

And

The keyword and.

@media
May 22, 201338 comments

CSS-Tricks Chronicle XIII

> go east > You see a beautiful grassy field. > set up camper > You camper is now set up [roundtime: 18 seconds] > sit down
May 21, 20135 comments

Prepros

Is an open-source app modeled after CodeKit. Prepros runs on Windows where CodeKit is Mac only. From people who have tried it, it seems good.…

May 20, 2013

Chrome’s requestAutocomplete()

Auto-filling forms is nice because it saves time and is less prone to user error. Even better is not even needing to see a form in the first place.…

May 20, 2013

*May or may not contain any actual "CSS" or "Tricks".