Color Animate Any Shape with a Knockout PNGUsing a graphic where the solid parts match the background of a site and the transparent parts make the shape, we can let a background color bleed through. This allows us to set that color through CSS, and do any fancy thing CSS can do, like say animate that color. | June 7, 2011 | 23 comments |
→ Online Conference: CSS SummitTuesday/Wednesday July 26/27, 2011 is the CSS Summit, an online conference all about CSS. I’ll be talking the second day. Super hot lineup! Use the code 20COYIER to save 20% on any type of ticket.… | June 7, 2011 | |
Recent BitsI was out last week getting my bluegrass festival thing on. I’m just catching up with the ol’ internet and thought I’d recap the interesting bits:
… | June 6, 2011 | 15 comments |
In IE, iFrames on Pages in Quirks Mode Also in Quirks ModeJust wanted to make sure that this was documented. Here’s what I think the most important lesson is: If you are creating a page using HTML5 and you think there is some reasonable chance that someone may embed this page … | May 26, 2011 | 33 comments |
→ Styling List MarkersHave you ever tried to style the numbers in an ordered list? You end up doing dumb stuff like wrapping the insides in spans, styling the list items, then removing that styling with the span. Or using background images in … | May 25, 2011 | |
Creating a Body BorderA border that goes all the way around the browser window and stays there when you scroll. In this article we cover a few different techniques to get it done, from the deepest browser support to the most progressive. | May 25, 2011 | 77 comments |
→ Animated 3D Objects Without SVG or CanvasOne of the ways you can make a triangle with CSS is by using a 45-degree angle gradient on an element that goes from from colored to transparent with an hard split at the half-way point. Then you can use … | May 24, 2011 | |
Choice & Value PairLet’s say in a form you need to allow the user to select a single unique choice. That’s the territory of either a select dropdown menu or a group of radio buttons. Now let’s say there is direct follow-up question … | May 24, 2011 | 23 comments |
When Using !important is The Right ChoiceUsing !important rules can be a dangerous road to start going down, but they exist for a reason. There are some good use cases which we’ll cover here. | May 22, 2011 | 49 comments |
Prevent White Flash While iFrame LoadsHow to prevent an iframe from flashing white while the page is loading. An ugly problem when the background of your site is anything other than white. | May 17, 2011 | 33 comments |
Full Browser Width BarsYet another useful thing that pseudo elements can do for us: allow us to create full browser width header bars without using internal non-semantic wrappers. | May 16, 2011 | 75 comments |
Good Idea: “What is this charge on my credit card?” PageIf you charge for something online, having a dedicated page on your site where you explain what the charge is on a credit card statement is a good idea. You can point people to this page via a short URL right on the credit card statement. | May 15, 2011 | 9 comments |
→ RewardJSFix a bug. Get a prize. A site to incentivize helping out on open source JavaScript projects. Every single day there is a prize that someone earns through sheer number of bug fixes closed. Also weekly and monthly prizes on … | May 11, 2011 | |
Personal Blogs of Web People That I Like To ReadMy favorite blogs are personal blogs of one person. I like it when blogs “have a voice” and personal blogs can’t help but have that since all the writing is by the same person. I read a bunch of them and I thought I’d share. Below is a big ol’ list that are specifically people that blog, generally, about web stuff – be it design, development, entrepreneurship, typography, business, illustration, whatever. You probably know a lot of them. Maybe some of them you don’t. | May 11, 2011 | 87 comments |
Upcoming TalksI’m talking at a bunch of events coming up this year. Come to them! | May 10, 2011 | 12 comments |
→ FitTextFitText makes font-sizes flexible. Use this plugin on your fluid or responsive layout to achieve scalable headlines that fill the width of a parent element. Super simple, super nice effect, super practical jQuery plugin by Dave Rupert. You need to … | May 10, 2011 | |
→ CSS Regions DemosAdobe has put together some pretty compelling demos of “CSS Regions.” Download the package and run the included “Mini Browser” to see them. You define shapes (kinda like an image map) in which content flows. If needed, you define how … | May 10, 2011 | |
→ Masonry CSSSimple and damn clever idea by Radu Chelariu. Use multiple columns and inline-block elements to create that “masonry” / staggered block layout that is hugely difficult to do otherwise. … | May 9, 2011 | |
Case Study: jQuery Fixer UpperWe’ll look at some jQuery code that a CSS-Tricks reader posted in the forums. We’ll suggest ways to improve the code to make it more efficient and more extensible. We’ll also make some guesses about the HTML that it goes with and discuss improvements there. | May 8, 2011 | 55 comments |
Window Inactive StylingUsing some non-standard pseudo selectors, you can change the styling of things when the browser window is inactive. The only “practical” use right now is text selection colors, which automatically do this unless you override it. But we’ll fix that! | May 6, 2011 | 13 comments |
→ Outer Border Radius TabsImagine a real-life tabbed folder. The tabs on those aren’t only rounded at the top of the tab, but they also connected to the folder with a rounded edge. Top corners, easy, just | May 5, 2011 | |
→ Border Radius on ImagesIf you ever tried to use | May 5, 2011 | |
Restart CSS AnimationWith CSS animations (ala @-webkit-keyframes) it’s not as easy as you might think to “restart” it. Let’s say you set it to run once:
and you have that … | May 5, 2011 | 26 comments |
Browser Support for :before/:after Pseudo ElementsThe exact (pretty much) browser support levels for these style of pseudo elements. It’s pretty darn deep, folks, and you can do really cool things with them while keeping your markup clean. | May 4, 2011 | 29 comments |
The Net Awards Nominations OpenThe Net Awards are now open for nominations. They are web industries longest running and biggest awards as far as I know. I think it’s nice to have people and teams get recognized for outstanding work. These are the … | May 3, 2011 | 11 comments |
→ Font Sizing with REMOne of the problems with using “em” as font sizes is that they cascade, so you are forever writing rules that select nested elements to reset them back to 1em; CSS3 now has rem (“root em”) to prevent that issue. … | May 2, 2011 | |
Custom Scrollbars in WebKitYou can customize scrollbars in WebKit browsers. Here’s the CSS you need to know about to get it done, with examples. | May 2, 2011 | 54 comments |
Twitter Account(s)The point: on Twitter I’m @chriscoyier. If you prefer a stream of links from CSS-Tricks only, you can follow @real_css_tricks. | April 29, 2011 | 24 comments |
Responsive Data TablesTables of data can only squish horizontally so far, so they can be a pain to browse on small screens (like mobile devices) where you may need to scroll both horizontally and vertically to browse the information at readable text sizes. We’ll explore a CSS-based possible-solution to this issue. | April 27, 2011 | 41 comments |
New Poll: Working EnvironmentThe new poll (in the sidebar) asks: In what environment do you primarily work? I’ve worked from home for a lot of years but that will soon be changing. I’m interested to know the environment readers of this site work … | April 25, 2011 | 67 comments |
→ CSS Gradients from ImageNicole Sullivan thinks “wouldn’t it be a nice if there was a tool to convert an image of a gradient into CSS code?” The community responds with some newly-created tools to do just that. I couldn’t get either of the … | April 25, 2011 | |
→ CSS Stress TestingBookmarklet from Andy Edinborough which analyzes your page by removing class names one by one from all elements and testing the pages scroll performance. In other words, if you are having trouble scrolling a page and suspect it’s fancy CSS3 … | April 24, 2011 | |
Poll Results for Conditional CommentsHow did people respond when asked if they wanted the power to serve content conditionally to any browser? The results are pretty interesting… | April 22, 2011 | 27 comments |
Fun With Blurred TextWe’ll cover how to blur text with CSS3 and do it safely by feature-detecting first. Then we’ll do a bunch of experiments with individual letter blurring and also some clever jQuery which gives us deeper access into specific values of a text-shadow. | April 21, 2011 | 34 comments |
→ CSS vs CSS3Trent Walton designs a website then codes it up two ways: new school CSS3, and old school image slicing with no CSS3. Going new school meant 1) he could do it faster 2) the page size was smaller 3) less … | April 21, 2011 | |
→ Micro ClearfixNicolas Gallagher challenges some old assumptions about what’s needed to make the pseudo element style “clearfix” work. … | April 21, 2011 | |
→ 39 Box Shadows, No Good ReasonExcept it’s the best reason of all: HOT CSS NERD ACTION.… | April 21, 2011 | |
The Difference Between :nth-child and :nth-of-typeThese are different pseudo class selectors that do slightly different things. In my opinion, :nth-child is more common but :nth-of-type is more useful. | April 20, 2011 | 20 comments |
Faking ‘float: center’ with Pseudo ElementsUsing a couple of floated pseudo elements on the elements containing columns of text, we can knock out a part in the middle making it look like text is wrapping around an image both directions. | April 18, 2011 | 59 comments |
→ CSS Gradient Patterns GalleryGradient wizard Lea Verou compiles all her crazy I-didn’t-know-that-was-possible patterns into one library with easy to snag code samples. Make sure to click the patterns for full screen view.… | April 15, 2011 | |
Value Bubbles for Range InputsHTML5 range inputs, in supported browsers and by design, don’t show the user the actual value they are submitting. If you want to use the cool slider, but show the value, you’ll have to do that yourself. Here we use the output element and jQuery to show the current value in a bubble that hovers above the range input. | April 13, 2011 | 14 comments |
→ IE 10Right on the heels of IE 9′s release, there is already a platform preview for IE 10 (video). Awesome: Flexbox, Grid, Multi-column, Gradients, (and soon), Transitions and 3D Transforms Not awesome: No text shadow, No HTML5 Forms support… | April 12, 2011 | |
→ Front End Design ConferenceJuly 22, 2011 – St. Petersburg, Florida. This is the third year going. Two years ago, I spoke at the first one which was my first “real” speaking gig ever. This year I’ll be talking CSS, which, strangely enough, I’ve … | April 12, 2011 | |
→ :any()Marco Kuiper with some real world examples of how the :any() selector (already live in Firefox 4 and WebKit nightlies) can clean up otherwise clunky selectors. … | April 11, 2011 | |
Play Sound on :hoverUse JavaScript to trigger the playing of a sound (an HTML5 audio element). A couple of ways to do it are presented here, along with a few gotchas to watch for. | April 11, 2011 | 37 comments |
→ WhatFont Bookmarklet
… | April 9, 2011 | |
→ The Cicada PrincipleSo there is this bug… also prime numbers… and… just read it it’s really neat and has practical web design implications. … | April 7, 2011 | |
What if there was no position: static;?A fun thinking exercise for CSS nerds! What if all elements defaulted to relative positioning instead? What are the advantages, disadvantages, and caveats to consider… | April 5, 2011 | 35 comments |
Reveal a Background Image upon Text SelectionHighlight text, reveal an actual image beneath! Not possible with the text selection pseudo class, but is possible by wrapping selected text in spans via an open source JavaScript library and adding the background image to that. | April 4, 2011 | 25 comments |
→ GlowformSuper hot color gradient glowing action by Kayla Rose.… | April 2, 2011 |