CodeinWP CodeinWP

CSS Specificity Should Be (Mostly) Irrelevant

CSS Specificity Should Be IrrelevantThere have been numerous articles written by some very reputable people discussing the topic of CSS specificity.

I think it’s great if a CSS developer wants to learn the ins and outs of specificity, because it is an important aspect of how CSS works. But I’m going to put forth an argument here that CSS specificity is quite overrated and, in fact, learning about CSS specificity has the potential to degrade the quality of your code.

Read Article

Why Use the Triple-Equals Operator in JavaScript?

Why Use the Triple-Equals Operator in JavaScript?“Determining whether two variables are equivalent is one of the most important operations in programming.” That’s according to Nicholas Zakas in his book JavaScript for Web Developers.

In other words, throughout your scripts you’ll probably have lines comparing values. JavaScript beginners who try to adhere to best practices may be using triple-equals and not double-equals, but might not fully understand what the difference is or why it’s important to stick to triple-equals.

Read Article

Browser Support for CSS3 Selectors

Browser Support for CSS3 SelectorsNow that the numbers for IE6 and IE7 usage are diminishing rapidly, more and more development teams are starting to weed out support for those older browsers.

Most readers will probably have removed IE6 completely from the equation and soon IE7 will follow. Despite IE8 still having the highest share of any single browser version, the demise of IE6/7 now allows us to be more creative with CSS selectors.

This post will provide a comprehensive review of support for CSS3 selectors in the most troublesome browsers (guess which ones?). Each selector links to the appropriate location in the CSS3 spec.

Read Article

Options for Styling Text Links and Hover States

Options for Styling Text Links and Hover StatesBecause the web is built on links, how we style our links (i.e, anchors, or <a> tags) should always be an important part of a site’s overall design, branding, and feel.

I’ve seen so many variations on the link style/color and hover style/color combination, that I thought it would be interesting to list as many of them here as possible. Some of these will be quite common and humdrum, while others may be ugly and impractical. I tried to stay away from really bizarre animated stuff, but instead chose to stick to those that you might actually see on a web page.

Read Article

Every Time You Make a Good Business Decision, a Puppy Gets Cloned

Puppy Gets ClonedA List Apart’s Issue #344 went live yesterday with a focus on the recent vendor prefix drama. I didn’t get a chance yet to read the entire Meyer/Tantek interview, but I did read Lea Verou’s piece.

First of all, congratulations to Lea for getting published in ALA. She’s certainly one of the most talented web developers I know, and deserves to be featured in such a context. I hope Zeldman and company continue to use new and fresh authors like her.

So what’s the point of my post here? And what’s the deal with the hyperbolic title that resembles Lea’s? Well, in many ways, this post is a response to what Lea wrote in her article. But this is not to say that what I’m going to write necessarily contradicts or opposes what she’s written. For the record, I agree with the spirit and forward-thinking approach in her post.

Read Article

Callback Functions in JavaScript

Callback Functions in JavaScriptIf you’re fairly inexperienced with JavaScript but you’ve used jQuery, then its likely you’ve used callback functions. But maybe you don’t fully understand how they work or how they’re implemented.

In this post, which is based on what I’ve learned about callback functions, I’ll try to enlighten you on this fairly common JavaScript technique. And maybe some of our JavaScript experts can chime in and let me know what I’ve omitted or oversimplified.

Read Article

Book Giveaway: The Book of Ruby

Book Giveaway: The Book of RubyI was unsure of what to write about this week and then I remembered that I had been meaning to post something to promote and give away a hard copy of a book that No Starch Press was kind enough to give me for free.

Below I’ll give you some simple instructions on how you can win my brand new copy of The Book of Ruby by Huw Collingbourne. You’ll never believe what you have to do to qualify for this one! (Note the sarcasm.) But first, a description of the book.

Read Article