Author:

I create websites and help others create better websites through writing and speaking. I consider myself a lucky man for getting to work in such a fun and rewarding field.

Twitter: Follow Chris Coyier on Twitter

[Ask SM: CSS] Equal Spacing, CSS Font Replacement

This is our fourth installment of Ask SM, featuring reader questions about Web design, focusing on HTML, CSS and JavaScript. In this post we’ll cover how you can distribute the horizontal space between elements evenly, how you can achieve maximum sides on images; you'll also learn best practices for CSS font replacement and answers to a couple of quickfire questions.

If you have a question about CSS or JavaScript, feel free to reach me (Chris Coyier) via one of these methods: a) Send an email to ask [at] smashingmagazine [dot] com with your question; b) post your question in our forum, c) or, if you have a quick question, just tweet us @smashingmag or @chriscoyier.

floaties

Antoine Nicolas writes: Do you know how to perfectly and dynamically distribute objects horizontally in a container using CSS? This is a classic example of something that is fairly difficult to do in CSS but probably shouldn't be. I have approached this problem in a number of different ways in the past. I have revisited it a little now, and I'll present what I believe is the best solution here.

Read more...

Ask SM [CSS/JS]: Divs of Equal Height, Dealing with IE 6

This is our third installment of Ask SM, featuring reader questions about Web design, focusing on HTML, CSS and JavaScript. In this post we'll cover how you can take care of a smooth page scrolling and Internet Explorer 6 bugs. You'll also learn how to aggregate RSS Feeds, how to create dynamic width list images and how to create div-containers of equal height.

IE Bugs

If you have a question on HTML, CSS or JavaScript, feel free to reach me (Chris Coyier) using one of these methods:

Please note: I will answer as many questions as I can, but I will certainly not be able to answer them all. I hope that you will use the forums to post questions because that will give you an opportunity to get help from the community as well.

Read more...

Ask SM [CSS/JS]: Pixel Width Decisions, Modal Boxes

This is our second installment of Ask SM, featuring reader questions about Web design, focusing on HTML, CSS and JavaScript. If you have a question about one of these topics, feel free to reach me (Chris Coyier) through one of these methods: send an email to ask [at] smashingmagazine [dot] com with your question, post your question in our forum (you will need to sign up and yes, the forum is not officially launched yet, but it is running!) or, if you have a quick question, just tweet us @smashingmag or @chriscoyier with the tag “[Ask SM].”

Screenshot

Please note: I will do what I can to answer questions, but I certainly won't be able to answer them all. However, posting questions to the forum gives you the best opportunity to get help from the community.

Read more...

Ask SM: How Do I Create A Colorful Sitemap With jQuery?

We like to experiment with new ideas and concepts. We like to challenge ourselves and provide our readers with new formats. This post is the first in our "Ask Smashing Magazine" series, in which well-known developers from the web design community answer our readers' questions and suggest solutions to common problems.

Today, we are glad to welcome Chris Coyier, who you may know from his articles on CSS-Tricks, to our Smashing Magazine Editorial Team. From now on, Chris will regularly answer your CSS- and jQuery-related questions and present answers to the most interesting, useful and original ones in his articles on Smashing Magazine. Welcome, Chris!

example

Of course, you can send any CSS- and jQuery-related question you want. To ask a question, you can do any of the following:

  1. Send an email to Chris at ask [at] smashingmagazine [dot] com with your question,
  2. Post your question in our forum, putting "[Ask SM]" in the thread title (yes, the forum is not officially launched yet, but it is running!),
  3. Or, if you have a quick question, just tweet us @smashingmag or @chriscoyier with the tag "[Ask SM]."

Please note: Chris will do what he can to answer most questions, but he will certainly not be able to answer all of them. However, we hope that our forum may help you to solve your problem in case Chris couldn't help you out.

Read more...

12 Principles For Keeping Your Code Clean

Beautiful HTML is the foundation of a beautiful website. When I teach people about CSS, I always begin by telling them that good CSS can only exist with equally good HTML markup. A house is only as strong as its foundation, right? The advantages of clean, semantic HTML are many, yet so many websites suffer from poorly written markup.

body class example

Let's take a look at some poorly written HTML, discuss its problems, and then whip it into shape! Bear in mind, we are not passing any judgment on the content or design of this page, only the markup that builds it. If you are interested, take a peek at the bad code and the good code before we start so you can see the big picture. Now let's start right at the top.

Read more...

↑ Back to top