Archive for the ‘CSS’ Category

Learning through mimicry

Monday, September 24th, 2007

There are several web design projects I am actively working on at the moment. Some are for my real day job but many are personal endeavors I am likely not to finish. Nonetheless, these projects forced me to solve interesting problems I knew someone else had already solved before me.

Why reinvent something when you can just “view source”?

By no means am I implying you should copy the others, but you should at least take a few seconds to try and understand the concept behind their solution.

This is a quick, rough list of the things I’ve learned; especially by looking at Apple.com and Google Maps.

CSS Browser validation

If the programming language being used permits it, you should have quick access to the surfer’s browser as the page is loading. By cleaning this string, you can extract a rough approximation of the browser’s type and version.

Afterwards, if you attach this cleaner and shorter approximation as the <html>’s id, all of the children nodes can be modified and tweaked using basic CSS rules:

p.box {width:200px; padding:10px;}
#explorer6 p.box { width:180px; }

This should be remembered when you can’t use conditional comments to fix a rendering issue. You can push it by adding the current page id to the <body> tag and continue filtering the rules further:

form { background-color:#000;}
body.contact form { border:1px solid #333; }
body.register form { border:none;}

Customizing recurring styles

When you have a global theme but each single page has a very different style for its content area, you can still use general styles and customize what you need at the lowest level.

For instance, a colum-based design is often used on web pages nowadays. You can still define a column set using these kind of rules :

.col_1_2 { float:left; width:60%;}
.col_2_2 { float:left; width:40%;}

With this is mind, you can build a widget or any sub-designed area with two columns. If this rules needs to change in only one page, you can override the rule to reflect new sizes.

It’s common sense and good use of CSS to try and sort out all the global widgets or recurring design types that way. However, when you think on a page-to-page basis, one might feel it isn’t necessary to link the style of the lowest webpage to the global skin.

On big project using exhaustive imbrication of templates, using global styles as startups will really save you some time.

Yahoo! as Standard Makers

Monday, June 11th, 2007

Long time indifference

Yahoo! is not a place I like to hang around. I guess it has all to do with how they handled the presentation of their search results back in the day. I never was a fan of categorized results — at least wasn’t ready to try harder to use them at that time.

So, for years I’ve been using AltaVista, then Google instead of Yahoo! search; Hotmail, then GMail instead of Yahoo! mail. Since I don’t like to be overrun with data, I don’t even read the news on their portal. The NY Times‘ and Radio-Canada’s RSS feeds suit me better.

In other words, I am not part of the gazillions of people that help make Yahoo! the most important website on the Internet at the moment, according to Alexa. I didn’t have much of an opinion on Yahoo! until they go so useful for the web developer I am.

YUI

Yahoo! Developer Network is a priceless resource for information on popular web technologies. What I’m more interested in however is the YUI section — the Yahoo! User Interface Libary.

Javascript

YUI seems to be built around Yahoo!’s own Javascript library. Similar to jQuery and Prototype, the YUI library helps writing Javascript code that is more efficient more quickly. Yahoo!’s library has proven to work faster than its competitors when working on the DOM. It is structured in a manner that seems closer to more classic programming languages.

Notably, you can create namespaces for your scripts as well fire as custom events. Obviously, you can create visual effects of custom controls for your interface using objects the community is developing. Broken down in many files, you can import only the libraries you need in your application from Yahoo!’s servers. No hassle in storing multiple version of the files.

Templates

The section supplies a collection of pre designed templates for anyone to use. Wether you need a 3 column fixed layout, or fluid 100% wide 5 columns templates, you will find the XHTML and CSS files in the YUI section completely free. Free as in no charge, but also free as in open source.

Cross-platform

Most importantly, the library is guaranteed to be working the same on any Grade A browser. Other libraries don’t always live up to that mention as the script gets more complicated.

Standard Pipes

While the tools themselves are incredibly useful and time saving, it’s not the best thing about the YUI. Through guidelines, tutorials and free files, Yahoo! is lowering the pain of doing web design for people who don’t know about standards or who just don’t care. If an important company like Yahoo! continues providing resources and using their influence in the developer’s community and the software makers building the browser, the Internet can standardize fairly quickly.

Yahoo! seems to be pushing towards a better Internet and the same cannot be said of everyone in the top most influential website.

Accessibility Vs. The Real World

Friday, August 25th, 2006

Jeff Croft, not afraid of being lynched by the new wave of accessibility-aware Web 2.0 designers, has posted a new article asking if accessibilty has been taken too far.
While I’m guessing his opinion may have been toned down on the way from his head to his hands, I do believe he has a point. To paraphrase and sum his opinion: “Accessibilty is cool and all because it’s bad to ignore people with dissabilities, but you can’t expect a company to spend all their web design budget for 0.5% of their customers. Therefore, some site aren’t 100% accessible on purpose.”

And it’s true. In real life, my employer gives me, say, 4 days to finish a website. It’s good enough if I can be satisfied with the sementics of things in that period of time. Odds are I won’t have any time left to make seperate style sheets with high-contrast colors, one with big text, etc.

All can agree that it’s a good thing that there’s a not more awareness around the accessibility of online content at the moment. However, just like in any trend, it’s all too easy to laugh at those who don’t follow it, making up reasons for those not following it revolving around their stupidity and insolence and start running circles your little trendy group.

CSS Specificity

Wednesday, August 23rd, 2006

If you’ve played along with CSS a bit, you know (like I do) how to use CSS selectors in most everyday cases.

But I have never even thought about how they interact on each other much more than that. Which CSS rule wins if you start combining regular class calls, mixed with ID and html tag selectors?

Well, CSS: Specificity Wars explains it all using Star Wars metaphors! I couldn’t be happier.

There’s even a visual chart that you can print. Awesome.

CSS Optimization

Thursday, August 17th, 2006

There are plenty of css optimizers out there, but BloggingPro were kind enough to make a comparative chart of 5 different ones.

Removing the dotted border around links

Friday, April 21st, 2006

Did you know you could remove the dotted border around your links? I didn’t. You just have to specify the outline CSS property. You can read a more in-depth explanation at Sonspring.

a { outline: none; }

Decorating type using CSS

Monday, December 5th, 2005

I found this very promicing technique. I can only imagine all the effects you can get once everyone supports transparent pngs.

how he does it;
more exemples.