Miragecraft
  • Hello, And Regards
  • Seleted Works
  • Random Thoughts
  • About

In addition, older works can be found at my old website.

RésuméEmail

Copyright ©2011

Random Thoughts

Pieces of Broken Thoughts

•   •   •

CSS Hack Versus Conditional Comment

Which one is better to tame Internet Explorer? May 13, 2011

It really depend on the CSS code.

Bascially speaking, CSS Hack helps you keep all attributes belonging to an element in the same place; while conditional comment helps you keep all the IE hacks in the same place. Invariably that means the more IE over-ride you have to apply, the more sense CSS Hack makes since you don't go hunting in two stylesheets in order to make modifications.

•   •   •

W3C Validation Certificate is Useless Now

Outputs errors and warnings for vender specific extensions May 13, 2011

Is there any point to having the W3C Validation badge anymore?

I remember getting that validation badge on my old website and feeling pretty smug with myself. But nowadays even Google doesn't validate on the CSS validator anymore, due to vender specific extention not being recognized as valid.

However more than a few important CSS3 properties were all implemented extensively through vender-extension (border-radius & gradient) that all three major browser supports it - IE, Firefox & WebKit Brotherhood (Safari, Chrome... etc). So it is fair to say that althought it is messy, implementation is widespread and here to stay.

But W3C won't issue a passing grade if it detects vender specific extensions.

Too bad, W3C needs to get on with the times or watch as it's once revered validation badge becomes irelevant.

•   •   •

Learn the Rules, And Then Break Them

Why sometimes it is good to deviate from standard practices May 12, 2011

There's a lot of standard practice in web design, such as "don't use table for layout", "apply alt tags to all images", and "class/id names for page elements should be semantic".

A lot of people learn about those practices and they follow them to the very last letter. There's nothing strictly wrong with that, as I was one of those people not too long ago.

However the important thing is to understand why those rules were created in the first place, and by understanding them throughly you will find that in many circumstances it is better to break those rules for the best results.

For example, it is actually better to use table for layout when you want to have multiple columns stretching all the way to the bottom of the page. There's no easy way to do it in CSS, and what should work (display: table-cell) doesn't work in all browsers. So the easiest solution would be to throw down a single table to keep the layout from breaking and use divs for the rest.

Is this wrong? Hardly. To go and implement the same thing in CSS with many IE hacks and unnecessary DIVs is to run afoul of the mistake people made back when they were using tables - excessive, messy code.

And when an image is used as pure decoration there is absolutely no need to put an alt tag, such as an image that can be described as "Two business women smiling at the reader". There's no purpose to create an alt tag for taht! Sure the spec says alt tag should be included, but that's to ensure no useful information is lost for people who can't view images or graphics such as the blind, it is no reason to puff up a webpage for no purpose other than to follow the letter of the rule.

Finally, I'll touch upon the newest trend in CSS - frameworks. The popular ones includes Yahoo! YUI, Blueprint CSS, and 960 Grid System. Personally I use 960, and it is such a breath of fresh air. Some people have been complaining that using class names such as "grid_2" isn't semantic. Let me tell you, it might not be as semantic as it can be, but it is clear, intuitive and it is tremendously helpful. Sometimes there's a trade off, and I think it is worth it.

Therefore, know the rules, but more importantly, know the reason those rules were created and then you will know when you should break them.

•   •   •

Quest for Imperfection

My I have your permission to fail? May 12, 2011

Recently on Reddit, a poster commented that perfectionists tends to procrastinate, because they set too high of a target for themselves therefore expecting too much from themselves; as a result they get paralyized with fear and ended up putting things off.

I find that observation shockingly accurate in describing my own behaviour at times when I hit a block, I have to remember to take it easy on myself.

•   •   •

It's Good to be Back

Has it really been that long? April 22, 2011

Thanks for dropping by, as you can see, the new design is up and ready.

By the way, if you are looking for my previous website which was featured on many CSS galleries you can still view it here.

•   •   •