background preloader

CSS

Facebook Twitter

Code smells in CSS. 20 November, 2012 Chris Coyier recently answered someone’s question: How can you tell if your CSS code smells?

Code smells in CSS

What are the signs that the code is sub-optional, or that the developer hasn’t done a good job? What do you look for in the code to determine how good or bad it is? I thought I would extend Chris’ great answer with my own, additional take on things… My day-to-day life is spent working in-house at BSkyB… I work on big websites, the last of which took me over a year to build the front-end for (and it’s still ongoing). Highlighting current page with CSS.

With handy online resources such as List-o-Matic, its now easier than ever to use unordered lists to create navigation.

Highlighting current page with CSS

As an extra help to users, why not highlight the current page in the navigation? A recent article on A List Apart called Keeping Navigation current, showed how to do this with PHP. Here’s an easy solution using CSS. First we’ll set up our navigation list. 960 Grid System. The 960 Grid System Made Easy. By Joshua Johnson The first time I discovered the 960 Grid System, I was immediately excited about the possibilities of implementing complex layouts so easily.

The 960 Grid System Made Easy

However, since I was fairly new to web design at the time, when I downloaded the files, I quickly became overwhelmed at how complicated the whole thing seemed. 25 Advanced CSS Tips & Tutorials. Developing Your Own CSS Framework. Quite a few CSS frameworks have been around for a while, but most web developers avoid using them.

Developing Your Own CSS Framework

Instead most veteran developers prefer to create their own CSS framework, which provide benefits of a personalized solution and minimizes negative aspects of depending on a third party solution. CSS3 Patterns. Many of you have probably seen my CSS3 patterns gallery.

CSS3 Patterns

It became very popular throughout the year and it showed many web developers how powerful CSS3 gradients really are. But how many really understand how these patterns are created? The biggest benefit of CSS-generated backgrounds is that they can be modified directly within the style sheet. This benefit is void if we are just copying and pasting CSS code we don’t understand. We may as well use a data URI instead. Important note In all the examples that follow, I’ll be using gradients without a vendor prefix, for readability and brevity. The syntax described here is the one that browsers currently implement. If you are not yet familiar with CSS gradients, you can read these excellent tutorials by John Allsopp and return here later, as in the rest of the article I assume you already know the CSS gradient basics: The main idea I’m sure most of you can imagine the background this code generates:

CSS-Tricks. W3Schools CSS. Lightbox 2. Responsive CSS Frameworks and Boilerplates Explained. CSS frameworks have been around for years now, but the arrival of responsive design practices has rendered many of our old favorites useless.

Responsive CSS Frameworks and Boilerplates Explained

Fortunately, lots of really talented developers have jumped in to fill the gap with the next generation of CSS frameworks and boilerplates. There’s already a ton of these things floating around. Everyone has a list, but no one really walks you through how each framework and boilerplate differs from the next so that you can make an informed decision. That’s our goal today. Follow along as we take a look at what makes each of these 22 responsive CSS frameworks and boilerplates unique. Gumby The Gumby framework takes the 960 grid that we all cut our teeth on years ago and brings it into the modern age of web design with a responsive touch. The Semantic Grid System If you hate grid systems and their bloated, non-semantic markup, this one is for you. Gridless Frameless Proportional Grids The Goldilocks Approach. 7 Great CSS Text Effects.

Time for a bit of fun with CSS!

7 Great CSS Text Effects

The following examples are all created using live text and the CSS text-shadow property. Apart from the Letterpress effect, all of the following examples make use of multiple shadows, and as such will only work on the following browsers. Firefox 3.1+ (Mac/Win/Lin)Safari 4+ (Mac/Win)Chrome (Mac/Win)Opera 9.5+ (Mac/Win/Lin) Unfortunately Internet Explorer (6/7/8) has no support for the text-shadow property. If you're not familiar with the text-shadow property here's a example and explanation: It breaks down like this: create a shadow below the h1 and offset it -2px horizontally, 2px vertically, blur it by 3px, and colour it pink. 1 Classic Letterpress Effect This is a very simple effect to achieve. 2 Cloudy Text Effect This effect relies on multiple text shadows and rgba colours. Basically, that's white in rgb, (255,255,255) at 50% transparency (0.5). CSS Rules Every Web Designer Should Know.

Through experience as web designers we memorise all kinds of code syntax, hacks and snippets. With CSS in particular there is a number of rules and declarations that can really help transform your website designs and open up new possibilities when compared to older techniques. This post rounds up 10 declarations and tips that every web designer should have available in their CSS arsenal.

@media screen and (max-width: 960px) { } The @media rule not only allows you to specify styling for your web page when printed. These days media queries are more associated with the creation of responsive or adaptive website designs. A cool and extremely useful CSS3 property that has now gained thorough browser support is background-size. One CSS3 property that has really helped transform the web over recent years is @font-face.

The clever margin: 0 auto; declaration is one of the first snippets you learn when getting to grips with CSS.