Login or e-mail: Password:
Lost password |
Add article

Getting started with YUI Grids, Reset, and Fonts


Yogi Berra once said "it's deja vu all over again", and he was right. For each HTML/CSS template I build I find myself dealing with the same issues. How do I clear everything from that floated sidebar? How do I fix the margin and padding differences between IE and Firefox?

I recently tried the Yahoo User Interface (YUI) Library's Reset, Fonts, and Grids CSS and I'm here to tell you that YUI makes many of those CSS deja vu tasks things of the past.

Yahoo! developed YUI Reset, Font, and Grids CSS to work with A-grade browsers. Yahoo! uses these style sheets on their own sites, some of the most popular in the world, so you can rest assured that they work. Here's an overview of what you get.

YUI Reset and YUI Fonts CSS

YUI Reset and Fonts CSS create "a level playing field" by zeroing out browser's built-in styles. Margin, padding, and even list styles are removed. Headings are sized to the default font-size and look no different than normal paragraph text. A YUI Reset/Fonts styled page may look odd at first, but this "zero-out" approach enables an additive development approach, just build your styles on top of the YUI CSS foundation.

You can download the YUI CSS files or call them directly from the Yahoo! site. The following link includes all YUI foundation CSS.

<!-- Source File -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.2.2/build/reset-fonts-grids/reset-fonts-grids.css">


Once you've linked to the the foundation style sheets, create your own style sheet to size your headings, add a margin-bottom to paragraphs, and style lists. Be prepared to be amazed at how consistent your pages look across the board in IE, Firefox, Opera, and Safari.

I was able to quickly cut an existing style sheet's size in half! No more JavaScript style style switchers and I haven't needed to use conditional comments to target IE specific hacks.

Although the YUI CSS style sheets aren't terribly large, Yahoo! provides minimized versions of the files for optimal page load times.

YUI Grids

YUI grids takes the hassle out of creating CSS-driven layouts. Grids consists of several CSS id's and classes that can be mixed and matched to create a variety of page layouts. You can create fixed or fluid-width layouts quickly and Grids also provides 7 basic page/column layouts. It was easy to customize one of the stock layouts to create just what I needed.

The Yahoo! Developer network provides step-by-step instructions, several useful examples, and handy cheat sheets to help you get started. I've already built several page templates with the YUI style sheets and will feature what I've done in upcoming posts.

Links

Source: http://2tbsp.com/node/35


Similar articles
7 | comments: 0 | views: 1088 | Rafal Kinde
PHP is simultaneously the most infuriating and joyful languages you’ve probably ever worked with. “infuriating” primarily because the function names are so inconsistant. Here’s...
2 | comments: 0 | views: 577 | Łukasz Żyrański
David Meyer recently published a .NET class library that enables duck typing (also sometimes incorrectly described as Latent Typing as Ian Griffiths explains in hi...
2 | comments: 0 | views: 343 | Łukasz Żyrański
Raise your hand if you know how to validate an email address. For those of you with your hand in the air, put it down quickly before someone sees you. It’s an odd site to...
2 | comments: 1 | views: 281 | Łukasz Żyrański
I was thinking about alternative ways to block comment spam the other day and it occurred to me that there’s potentially a simpler solution than the Invisible Captcha a...
2 | comments: 1 | views: 239 | Łukasz Żyrański
In my last post , I wrote about how most email validation routines are too strict when compared against what is allowed by the RFC. Initially I dismissed this phenomena as the...
5 | comments: 0 | views: 270 | ghuh
As a webmaster, you want to keep your visitors content so they ll come back again. Here you will find ten common mistakes made by webmasters that may deter people from returning.
4 | comments: 6 | views: 1746 | Rafal Kinde
Back in the frontier days of the web, ”Webmaster” was a vaunted, almost mythical, title. The Webmaster was a techno-shaman versed the black arts needed to make words and images...
6 | comments: 1 | views: 1625 | ghuh
Learn and implement vital tips on increasing your website s performance. Find out how to make general improvements, how to optimize images, tweak HTML source code, get better r...
2 | comments: 1 | views: 138 | Łukasz Żyrański
Joe Cheng , member of the Windows Live Writer team, just unveiled his first publicly available Windows Live Writer plugin... I’ve just released my first (publicly a...
4 | comments: 3 | views: 26573 | Adam Tikacz
If you are developing a web-based system whereby a user, or users, are logging in and staying logged in (sessions, cookies), the following ideas are written with you in mind. M...


Read other articles from category: Programming



Discussion about article

Know something interesting? Have personal opinion? Share it.
Rate article



 Adam Tracz,  09/05/2007
I'm using YUI and I found that product useful.


Add your opinion
You must be logged in to write a comment. If you're not a registered member, please register. It takes only few seconds, and you get an access to additional functions .
 
Author
Article
rate:
ratings: 3
5

Add to favourites
Additional information
Groups




About EIOBA
Articles
Explore
Publish
Community
Statistics
Users online: 69
Comments: 545
Articles: 65.001
EIOBA World

© 2005-8 EIOBA group. All rights reserved