Treehouse: Grow your CSS skills. Land your dream job.

Article Archives

14 comments

Media Fragments URI – Spatial Dimension

Fabrice Weinberg shows us a future web technology in which you can use just a part of a bit of media. In this case, a part of an image. The ability to do this will open up some new possibilities for designers.

Internet Users Demand Less Interactivity

“Every time I type a web address into my browser, I don’t need to be taken to a fully immersive, cross-platform, interactive viewing experience,” said San Diego office manager Keith Boscone. “I don’t want to take a moment to provide my feedback, open a free account, become part of a growing online community, or see what related links are available at various content partners.”…

An Advanced Guide to HTML & CSS

Shay Howe has started a new learning series on HTML & CSS, this time moving beyond the basics into the real nitty-gritty stuff you need to know as a front end developer. 3/10 are done, with a new one coming each week.

If you need to start more basic, Shay's original "A Beginner’s Guide to HTML & CSS" is also great.…

51 comments

Zooming Squishes

Responsive designs can squish content inward when zooming, breaking a decent layout after just a few zooms. One reader writes in who really dislikes this on CSS-Tricks. But it's (mostly) fixable! Just make those media queries EM-based instead of pixel-based.

The Accessibility Project

Dave Rupert heads up a new project:

For many web developers, accessibility is complex and somewhat difficult. [The Accessibility Project] understands that and we want to help to make web accessibility easier for front end developers to implement.…

Wireframe.cc

I'm not hugely into wireframing, but I can see the value in some workflows. This tool for it is deliciously simple. I like the UI touch where if you resize the "browser" window small enough it turns into a phone.…

20 comments

HTML5 Drag and Drop Avatar Changer with Resizing and Cropping

In any app that has user avatars, users should be able to change those avatars. Anything to make that easier is desirable. Many apps start with a user's Twitter avatar, Facebook avatar, or Gravatar. That's a smart move. Avatars give users a sense of ownership over a virtual space so any way to get them to have their desired avatar is good for engagement.

Let's create a page where a user can update their avatar with as little friction …

95 comments

How Do You Structure JavaScript? The Module Pattern Edition

JavaScript is interesting in that it enforces no particular structure upon you. "Bring Your Own Organization", if you will. As I write more and more JavaScript in web app sites, this becomes more and more interesting. …

Interview with Ian Hickson

Bruce Lawson interviews the editor of the HTML spec. A candid look into how the web evolves and its future by someone who has a lot more power in shaping it than we do. You know it's going to be good when the first question is:

If you could wipe out any web technologies from existence, which would you choose?

And the answer is: everything.…

72 comments

Rethinking Dynamic Page Replacing Content

Jesse Shawl takes an old(ish) CSS-Tricks demo and updates it for today's world. Using the HTML5 history API he changes the URL and content of a page when navigation items are clicked, without refreshing the page.
6 comments

Workshop Notes from InControl Hawaii

In which I go over many of the important parts of a workshop I did for a small room of folks in Honolulu, Hawaii. Includes the Photoshop file we worked from (kinda) and a GitHub repo of where we ended up.

“Never Having to Leave DevTools”

Speaking of workflow stuff, check out this short video by Remy Sharp showing us how you can use Chrome DevTools as a code editor. Literally edit JavaScript and save it back to disk without ever leaving the browser.…

How to Create Retina-Caliber Favicons

John Gruber shows us tools and steps for creating retina ready favicons.

When I looked into this a few months ago only Safari was even supporting them, but it appears as if Chrome is now too, so I'd say it's time. Firefox and Opera still do not.

John recommends making an .ico with both 16x16 and 32x32 versions. The theory being that you can hand-craft a 16x16 aesthetically better than a browser can scale down your 32x32. For my simple …

ShopTalk Episode 49

This week Dave and I were joined by David Walsh, a long time fellow blogger and now Mozilla employee. We talk about em-everywhere, analytics discrepancies, tendonitis, and more! Thanks to In Control and Lynda.com for sponsoring. …

PPK on Gradients

The problem with gradients is that they are a syntactic nightmare. The gradient spec writers and browser makers changed their mind not once but twice. Thus we have three sets of syntax, and all three occasionally crop up even today. I call these old, middle, and new syntax.

I still haven't totally grokked the new syntax where linear gradients start with "to" or an angle.…

61 comments

Style Injection is for Winners

By "style injection", I mean being able to see styling changes immediately after authoring them without having to manually refresh your browser window. This isn't a brand new concept, I just mention it now because it's so awesome that if it's not a part of your workflow you should consider updating yours to include it.…

In Search of the Perfect Radius

A bunch of research from Rakesh on the correct values for nested border radii. The conventional wisdom is Inner Radius = Outer Radius – Border Width. This holds true here, but what if that yield a negative value. Also see this tool by Joshua Hibbert.…

All You Need to Know About CSS Transitions

Alex Maccaw with a bunchload of up to date information on CSS transitions. Includes some clever stuff like a trick to avoid transitioning width (not very performant) by instead moving the element and exposing more of it underneath.

I also learned from this that apparently there is an entire new spec for Web Animations.…

Progressive JPGs: A New Best Practice

There are two kinds of JPGs in this world: baseline and progressive. Progressive is just better. Ann Robson shows us why.

Experimenting locally with a throttled bandwidth, an 80K progressive jpeg beats a 5K baseline jpeg (the same image, downsized) to the page in Firefox on Windows. This should blow your mind. Sure, the progressive jpeg’s first pass is low-resolution, but it contains as much information, or more, as the small image. And if you are zoomed out, perhaps on …

Sass and Scattered Media Queries: “It Doesn’t Matter”

Many of us using Sass are writing our media queries "inline" one way or another. There is a fairly common concern that doing this "scatters" media queries throughout our compiled CSS rather than in a combined block as we would likely hand-author it. Isn't that inefficient? SassCast digs in and rounds up all the thinking and research.…

The Bookshelf Updated

These are all books that I own, read, liked, were helpful, and that I recommend.…

The Design Lesson

I like these thoughts by Andy Rutledge:

In graphic design, nothing is what it actually is. Everything other than content is representative of something else.

A line isn't a line, it's a boundary. Don't need a boundary? Or is that boundary already clear by some other means? Don't use a line.

Same goes for boxes, gradients, white space, scale, font, and any other design element there is.…

69 comments

Thank You (2012 Edition)

The annual report: statistics, milestones, old goals and new, and a hearty thanks from me as we head into 2013.
37 comments

5 Use Cases for Icon Fonts

Tim Pietrusky shares some ideas on how to use icon fonts as well as debuts his own new free service for icon font hosting.
40 comments

How To Deal With Vendor Prefixes

There are plenty of different ways to deal with vendor prefixes in CSS as part of your workflow. It depends on if you hand-author CSS or preprocess, and even then there are choices.

ShopTalk Episode 48

#CROSSOVER time with Jen Simmons from The Web Ahead! Jen, Dave and I talk about The Web Behind, the Instagram debacle, getting better, being critical of yourself, and more. Thanks to Lynda.com and InControl for sponsoring.…

Dive Into Flexbox

Greg Smith with a deep look at new/final flexbox (display: flex).…

CodePen PRO

Big day for me and the CodePen team! Many, many months of development have given birth to CodePen PRO, a set of eight brand new features. Things like Collab Mode, where you can literally write code and chat with other people in real time.…

CSS Hypenation

PPK: Hyphenation works!

Eric Meyer on places to avoid it.

In my own experience in the CSS-Tricks v10 redesign, at one point I had hyphenation turned on everywhere and got loads of complaints of certain versions of Firefox over-hyphenating things. Nearly every other sentence had a hyphenated word where it really didn't need to be.…

44 comments

So You’re Going To Start A Huge New Web Project

I was asked this past week to consult for a company embarking on a huge new website redesign. I thought I'd write up some thoughts that I would share with anyone in that position.…

Fastbook

Zuck was all like "HTML5 is too slow" and Sencha is all like "Whatever child take a peep at this."…

17 comments

CSS-Tricks Chronicle IX

A tribunal on the happenings of the the passing approximate fortnight.
34 comments

Slides From Recent Presentations

As you know, slides alone pale in comparison to being there to see a talk, but I still feel they are worth sharing. I've just gotten to posting up my last three prepared talks on SpeakerDeck.…

32 comments

BERG Cloud Buttons

The buttons at BERG Cloud are pretty sweet looking. It's not a hugely big deal, but the way they have created them uses two separate images (not sprited) and two internal spans. In this tutorial we will recreate them with some modern tricks. We'll use no images (more efficient), less markup (more semantic), and function smoother (no javascript controlling states).…

CSS Next

Divya Manian runs through many of the latest stuff coming in CSS. Including several things I'm hearing about for the first time, like specifying unicode range for an @font-face and canvas-as-background.

If you can't get enough, this talk by Tab Atkins (only works in Chrome) covers even more upcoming stuff, including more I'd never heard of. Things like image-interpolation (determines how images scale, like keeping sharp pixel boundaries), setting font-size with ex which is based on x-height (will be awesome …

ShopTalk Episode 46

Another RAPIDFIRE episode where Dave and I just do as many questions as possible. Including: why does Prototype still exist? What is good UX for target="_blank"? and the semantics of <cite>.…

Sauce Mac App

I quite like Browserstack, but Sauce has some pretty compelling features as well, like video recording of your testing sessions. Now Sauce has a native Mac app, which means you can do your old browser / cross platform / device emulation testing right from a dedicated app. …

GitHub’s CSS Performance

Interesting stuff by Jon Rohan on how simplifying HTML (just a little) and simplifying selectors (just a little) made huge impacts on page performance.…

12 comments

Rebuilding CSSLoad.net

In which Timur Gafforov explains how he rebuilt his one-page website for building loading animations in pure CSS.

Bootleg.css

Ryan Seddon recreates most of the Bootstrap JavaScript plugins without JavaScript. The :checked selector is the workhorse, like we've covered here, but Ryan is the OG of checkbox hacks. These things might get more powerful and more semantic if this goes well.…

ShopTalk Episode 45

This week Dave and I were joined by Harry Roberts and where we continue the discussion on IDs, how preprocessors help Harry's framework Inuit.css, visualizing how CSS transforms work, and more. Big thanks to InControl 2013 for sponsoring.…