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

Article Archives

14 comments

Are My Sites Up PREMIUM

Check out Abe up there hanging out. Abe is pretty stoked about the new Premium Service over on Are My Sites Up, and I am too. I really think any serious freelancer or web design agency should have at least some kind of system in place to be keeping an eye on their sites. These things are your babies, you should be responsible with them!

The new Premium Service has some awesome new features, some of which have just went …

45 comments

Browser Detection is Bad

And here is why:

It is against the spirit of web standards

The whole reason that web standards exist is so that we don't have to write specific code for specific environments. We should write code that adheres to established standards and software in charge of displaying our code should display it as the standards dictate.

It relies on the browser user-agent string

... which has a hilariously disastrous history and is easily spoofable.

It can hinder devices

Example: you …

46 comments

Set Font Size Based On Word Count

In my little Quotes on Design project, some of the quotes are longer than others. I thought it might be kind of nifty to beef up the font-size on the shorter quotes and trim down the size for the longer quotes so they all match a bit better in terms of the size they take up on the screen.

Rather than do this with a hard-coded number in each of the quotes, I did it with JavaScript. This allows for …

29 comments

Smashing Sitemap

I wrote up an article for Smashing Magazine on creating a colorful sitemap with jQuery. It covers all kinds of things, like semantic markup, enhancing with CSS3, building a quick jQuery plugin to avoid repetitive code, and more. Links to the example and the download are over there!

The article is also an introduction to me as a new writer over there. I'm going to be doing Question & Answer articles every few weeks or so. The focus will …

12 comments

Quick Notes

...and the winner of the Learning jQuery book giveaway is:

Nick from Crealities. I'll be in touch, Nick, to get your mailing address. Thanks to everyone who commented to win. Next time I'll try and get more stuff so everyone has a better chance to win.

Remember you can pick up copy right from Packt if you want to buy it. They offer 10% the cover price getting it from them. Otherwise check out the bookshelf for a link …

16 comments

Put a Subdomain on a Different Server

Over at Are My Sites Up we have a blog to keep users updated with new features, current issues and stuff like that. If, god forbid, the site were to go down, that blog wouldn't do us a heck of a lot of good in keeping people up to date if it was on the same server.

The solution is to simply keep the blog on a different server. But I didn't want to have the blog feel like some …

58 comments

Tracking Clicks, Building a Clickmap with PHP and jQuery

This demo and article was originally created by Jay Salvat and can be seen here in French. Thanks Jay! The Plan
  • Record the X and Y coordinates of the mouse cursor when it is clicked on a web page.
  • Save those coordinates to a database
  • When called, display a "clickmap" on top of the web page visually displaying the locations of those clicks.
Why?

Because it's a cool proof of concept. Should you use this in production and base …

159 comments

Save Money on SSL Certificates with SSLmatic

If any of you have built an eCommerce site for a client, you have probably dealt with buying and installing an SSL certificate for the site. While this isn't required, it's kind of stupid not to. I sure as heck wouldn't buy anything from a website needing my credit card without seeing that secure lock in my browser window.

Most hosting companies have some kind of deal worked out with some SSL certificate provider or another. Sometimes they set something …

323 comments

My Recommended Books: The CSS-Tricks Bookshelf

A few weeks ago I started a little new section of the site for books that I recommend on design and development. I'm calling it the CSS-Tricks bookshelf.

I own and have read (probably more than once) and fully endorse every single one of these books. The links to purchase the books are Amazon affiliate links, so their purchase supports me and this site a bit. Good place to get rid of them Amazon giftcards you got for Christmas …

31 comments

Using jQuery in Magento

At work we are developing a site for a client using the Magento eCommerce software. This is my first time using it and I'm finding it fairly badass (and it's free!). There is a lot to like about it, which we'll probably talk about another time, but it uses Prototype for a JavaScript library. Now I'm sure Prototype is wonderful and all that, but I don't know a lick of it. I'd rather just use the library I've known to …

38 comments

Select Cuts Off Options In IE (Fix)

I think the problem is fairly obvious here. If you set a static width on the <select> element and the width of the text in the <option> are wider than that, the text gets cut off in IE 6-8. There is no good pure-CSS solution for this that I can come up with or find. It has been tackled with JavaScript a number of ways.

23 comments

Add Design Quotes to Your Site

There is a much newer and nicer version of the Quotes on Design API now, check out the code over at the dedicated API page.

David Walsh helped me whip together an "api" for Quotes on Design. If you want to add a random design quote to your site, just add this snippet of code:

<blockquote id="qod-quote"> ... loading ... </blockquote> <script src="//quotesondesign.com/api/3.0/api-3.0.js" type="text/javascript" charset="utf-8"></script>

View Demo

This will insert a quote on your page, inside the "quote" …

24 comments

Typographic Grid

This is not a "framework" or anything, I was just screwing around with typography and getting things to line up according to a strict horizontal and vertical grid. It is inspired by the Compose to a Vertical Rhythm article by Richard Rutter a few years ago, except uses unitless line height.


View DemoDownload Files

font: 10px/2 "Lucida Grande", Helvetica, Sans-Serif;

I thought the results were very pleasing. If you have a site heavy on text content, I …

5 comments

The Last Links of Interest – Other Great Places for Links

I've done 62 Tuesday "Links of Interest" posts over the past 18 months or so. it's been fun and a good way to share links, but I'm letting you know this will be the last one. It's not because I don't like sharing links, it's because me doing it here is just a little redundant to link sharing I do elsewhere and it's starting to feel a bit too much like "filler" content. I look forward to saving myself a …

164 comments

PHP for Beginners: Building Your First Simple CMS

The Magic of PHP + MySQL

It's safe to say that nearly every website that's up-to-date these days is using some form of content management system (CMS). While there are a ton of great free options that provide us with a CMS to power a website (WordPress, Drupal, etc.), it doesn't hurt to peek under the hood and get a feel for how these systems work.

To get our feet wet as back-end developers, we'll be creating a simple PHP …

93 comments

Launch: Are My Sites Up?

Hey folks! Me and Richard have just launched a new site I think many of you will find useful. It's called Are My Sites Up? - I bet you can guess what it does =)

Monitor ALL your sites

The idea is that many of us are responsible for maintaining a number of websites. Business, personal, or otherwise. We simply don't have the time to go visiting every one of them every day, let alone every few minutes. So what …

41 comments

Thank You (2008 Edition)

Happy New Years Eve everyone! Just taking the opportunity to say thanks to everyone (again) for visiting and being a part of CSS-Tricks. This site has came a long way in one short year, and now is a great time to reflect.

Milestones

Screencast Launched

I moved to Portland, OR at basically the very first days of 2008. This site alone had me motivated to get my office set up as quickly as I could. I was already armed with …

3 comments

Links of Interest

Creative Advent Series...

...was pretty cool on Positive Space this year. Twenty-four creatives share their best career advice.

 

Merb and Rails Merging

David Heinemeier Hansson writes:

It’s christmas, baby, and do we have a present for you. We’re ending the bickering between Merb and Rails with a this bombshell: Merb is being merged into Rails 3!

We all realized that working together for a common good would be much more productive than duplicating things on each side …

54 comments

Dynamic FAQ Page – A Lesson in Accessibility and Progressive Enhancement

The idea is to make a question & answer style page which is embellished in functionality by JavaScript (jQuery). Each question will be shown in a box with a tag hanging from the bottom of the box. When clicked, the tag will slide out and reveal another box with the answer.

View DemoDownload Files

Considerations

This is by no means a difficult thing to accomplish, especially with jQuery. But this example is great for considering the implications of …

41 comments

New Poll: What is your CSS framework of choice?

Just tossed a new poll up. This time covering CSS frameworks, which we have never polled before. Kind of curious to see which of them is the most popular, among the people that actually use them. I've only included six of the ones that seem to me like the most popular, but if I have missed a really big one, let me know soon and I'll add it quick before there are many votes.

Poll is down in the sidebar. …

28 comments

Ho Ho Ho!

.wishing { you: happy-holidays !important; }

Have a lovely day everyone! It's definitely a white Christmas here in Portland. I plan to do a recap of the year next week and tell everyone just how thankful I am for this site and the community we have.

Sorry for no screencast today, I meant to get to it earlier in the week but it just didn't happen. It should be a fun one though next week. I've had many requests for …

15 comments

Poll Results: How do you keep track of design inspiration?

As always, fascinating results. I am part of the very smallest segment, in that I use an image-based social bookmarking service, ScrnShots, to keep track of a lot of my design inspiration. I'm not a nut about it though, and I definitely "cruise the galleries" as well.

I was surprised to see Local Bookmarks take the #1 spot. Seems like that could get unwieldy to me, and that local bookmarks sort of lack the annotation ability to deal with …

4 comments

Links of Interest

jQuery 1.3 Beta

If you want to help test, all the details are here. Many rewrites of core areas like the selector engine and DOM Manipulation (append/prepend/before/after).

 

Absolute Columns

Dan Rubin hits the nail on the head with a great way to handle columns of equal height.

 

WordPress "Art Direction" Plugin

Not all posts are the same, so why are they all designed the same? This plugin will allow you to apply styling that is unique to …

70 comments

Blurry Background Effect

When setting a background image on a page element with CSS, you can control its position with "background-position", but an often-forgotten trick is that you can control its position behavior with "background-attachment".

Utilizing two images, we can pull off a pretty simple and fun CSS trick I'm calling the "blurry background effect". Here are the results:

View DemoDownload Files

 …

15 comments

Site News: iPhone/iPod Stuff

Few quick announcements!

iPhone/iPod Version of Screencast

Many, many people asked for this. I resisted a long time mostly since I thought seeing them on such a small screen would be useless. But I concede that listening and sort-of seeing might be good enough, and you can always get the bigger version if you need to go back to something. iTunes here. Raw RSS here.

iPhone Interface

Just for kicks I brought back the iPhone interface for CSS-Tricks

42 comments

PHP Include from Root

When I reference images, I almost always do something like this:

<img src="/images/logo.png" alt="logo" />

That is a relative file path, but it begins at the root public directory of the site. That way it always references the same location, no matter what directory that code snippet ends up in. If it didn't begin with that "/", it would be a relative file path still but it would the location would depend on what directory you were in at the …

20 comments

New Site: Quotes on Design

Here's another new site from me. I love reading books about design, so I've made a little site to help immortalize the great little quotes I come across. There aren't a ton of them up there yet, but I plan to add to it whenever I come across anything good in a book, blog, or anywhere else I see a good one!

 

Visit Site

 

Got a good one to contribute? Go for it. …

9 comments

Links of Interest

Best Presentations from Web Design Conferences in 2008

Chris Spooner has put together a little roundup of videos from some of the best web design conferences this soon-to-be-past year. Makes me jealous! I've never once been to a web conference. Too dang expensive usually.

 

Modular Layout Systems

24 Ways has been fairly fun this year, but the best so far has been the post on Modular Layout Systems from Jason Santa Maria. Jason has what I consider to be …

16 comments

Force Secure Form Submission

I was working with a client eCommerce site the other day, and a really concerning problem popped up. On the very last step of checkout, when you press the very final button to submit the order, the browser would pop up a security warning telling the user that the page was secure, but the data being sent was not.

Not exactly something someone wants to see when buying stuff online.

A little digging revealed the browser wasn't being paranoid, it …

92 comments

New Site: HTML Ipsum

There are a number of Lorem Ipsum sites that I like. I even have a dashboard widget for generating it. But none of them does what I REALLY want, which is to give me the Latin text already in HTML tags. So, I built one.

 

Visit Site

 

Clicking on any of the blocks automatically copies the text to your clipboard! Let me know if you have any questions/comments/suggestions.…

7 comments

Links of Interest

DD_belatedPNG

Yet another PNG fix for IE 6, but this time with all our dreams come true. Positioning, repeating, and none of the link-blocking z-index madness. How does it work? Apparently the proprietary Microsoft VML language does a much better job than the AlphaImageLoader stuff the other fixes rely on. I'll say now that I haven't actually played with this yet so it's not an official endorsement, but from all the positive press on it, I'd say it's worth …

82 comments

Start/Stop Slider

A little while back I did a tutorial on a Featured Content Slider. It was neat, but a little limited in customization possibility. The two most requested features were being able to add/remove "panels" and a stop/start button.

I'm happy to say I was able to accommodate a bit with this new slider. It's not a plugin, so it's not as easy as it possibly could be, but it's much easier. There is a section at the end for …

55 comments

Building an Animated Cartoon Robot with jQuery

Why?

Aside from being a fun exercise, what purpose does something like this have? None that's plainly obvious. Its about as useful as a miniature ship in a bottle. Yet it does have an underlying purpose. It could inspire someone to look beyond the perceived constraints of web designers and developers.

View Demo

 

Overview

This project was created by layering several empty divs over each other with transparent PNGs as background images.

The backgrounds were animated at different speeds …

7 comments

Links of Interest

Double Background Effect with CSS


Soh Tanaka tackles a CSS layout problem that probably many have you have run into. The idea is double backgrounds, that is, having a centered design where the left side has a repeating design and the right site has a different repeating design.

 

New Wufoo Features

Most of you probably know I'm a big fan of Wufoo, the web service for building forms. (If you don't, I have an intro video here). …

6 comments

Creating Tabs That Behave

When creating navigational tabs that use real web text, some positioning issues may arise when that text is resized. The natural flow of a web page when text is resized is to push down. This can push your main content area down and/or force the tabs into that area. Using some smart CSS, we can fix this issue by creating tabs that grow upward when text is resized.

Bad Example

View Bad Example

In this example of bad tab behavior, …

11 comments

Prevent iPhone Text Enlargement

The iPhone has a funny way of bumping up the text size on websites when viewing them fairly far "zoomed out". This can be wonderful, as it can help the text be readable while seeing more of the website. It can also be unexpected, undesirable, and break otherwise perfect layouts.

To prevent this on your site, you can use this:

-webkit-text-size-adjust: none;

Apply it selectively, or directly to the body to prevent resizing everywhere.

Thanks to Ed Brandt for sending …

94 comments

The Very First Steps After a Fresh WordPress Install

So you have WordPress installed! Congratulations! Now what? I find myself installing WordPress quite often, so I'll share with you my "first steps" after a fresh install to get WordPress set up to my liking. This involves changing settings, resetting the theme, and some universally useful plugins.

At the time of this writing, WordPress 2.6.5 was just released. You know, "for future reference".…

Links of Interest

This weeks Links of Interest post is WordPress-themed, like the rest of this week =)

Web Designer Wall Series

Nick La is in the midst of a series on working with WordPress. So far he has done Installing WordPress Locally, Building Custom WordPress Theme and Exporting and Importing WordPress.

Fully Valid, SEO-Friendly Social Media Links for WordPress

One of the things that will always get ya when validating is un-encoded characters in URLs. This is particularly epidemic in …

32 comments

What to Ask a New Client Wanting a WordPress Theme

[original photo]

With any new client, before you start choosing technologies, you should be finding out more about them. What they are all about, why they need a website, and what the goals of that site are. But if you are past that stage and it becomes clear that they need a blog, and that blog will be powered by WordPress, here is a list of things you should ask to get started (in no particular order).…

34 comments

It’s WordPress Week!

I've been working with WordPress a lot lately. The redesign around has had me moving lots of stuff inside WordPress and using it more and more like a real CMS (video on this). At work lately we've been doing a ton of WordPress sites and it's just all up in my mind right now. So... to get it all out of my system, this upcoming week on CSS-Tricks is going to be WordPress Week! The theory here …

26 comments

Thoughts on IntenseDebate So Far

I've been using IntenseDebate on CSS-Tricks for a little over a week now and a lot of thoughts on it have been stirring around in my head so I thought I'd try to organize them and share.

What is IntenseDebate?

IntenseDebate is a service to enhance the traditional comment system on blogs. I'll get into more specifics about what those enhancements are later. The important idea is that it isn't a replacement comment system, it just works with your existing …

17 comments

Block a Website for Everyone But You

Quick little .htaccess trick today for ya'll. This snippet will redirect any visitor who is not at at one of the provided IP addresses. You can use as many or as few as you would like. This is just a very quick way to block access to a site for, say, everyone but you. Or, everyone but you and a few select co-workers or clients.

RewriteEngine On RewriteBase / RewriteCond %{REMOTE_HOST} !^71\.225\.113\.171 RewriteCond %{REMOTE_HOST} !^71\.185\.239\.212 RewriteCond %{REMOTE_HOST} !^69\.253\.223\.254 RewriteCond %{REQUEST_URI}
10 comments

Jeff Croft on Web Design

I would say my biggest pet peeve related to the industry would be people focusing on technology instead of design, standards instead of users, and validation rather than innovation. Web standards and best practices are noble goals, but all too often in our community people forget they are a means to an end, not the end itself.

Well said, Jeff.

From a post about web design pet peeves.…

4 comments

Links of Interest

Served

I have no idea how long these "served" sites have been around, but I dig 'em. typographyserved, photographyserved, etc.

 

Intense Debate

Commenting is the best thing about blogs. Really makes a blog into a community rather than a virtual megaphone to shout from. But the default commenting system on most blogs has been primitive for a long time. You enter your name and comment and submit it. The only chance you get to establish who you …

20 comments

Old School Clock with CSS3 and jQuery

Hi everyone, my name is Toby Pitman and Chris has asked me to write a post about a recent experiment that I posted up on the forum a little while ago. It all started when I was looking at the WebKit blog and saw an article on the new CSS3 animations and the one that caught my eye was 'rotate'. I started thinking what the hell can you rotate on a webpage (it's animated GIF's times ten!). Then it hit …

18 comments

Guest Post on Writing Better HTML

I was flattered when the guys from Smashing Magazine asked me if I'd like to write an article for them. I thought I would stick to my best subject and write about CSS at first. So I started a draft about developing good CSS habits. The first section was about how CSS doesn't live in a bubble and needs good HTML to go around it. In fact, good HTML is almost MORE important. That first section went on and on …

41 comments

Color Fading Menu with jQuery

Editor's note: When I first pushed out this latest redesign for CSS-Tricks, it featured a simple color fading animation in the main navigation. Liam quickly noticed a flaw in the code I was using to do it, where if you very quickly moused back and forth over the menu items some of the transitional color would "stick". Liam generously rewrote the code to be a bit smarter for me, and I asked him to write this tutorial. Thanks Liam!

Hello, …