Tuesday, October 14, 2008

HTML Tips & Tricks: PX and EM

Since I've never had the chance yet to implement the new design for this blog I decided to roll out a few HTML tips and tricks which I think could help people who are new to HTML web development.

This one focuses on the use of px's and em's in font sizes. In the not so old days if you want to set your website's fonts you would normally use px with font sizes.

A better way to design html web pages is to use em's rather than px's, because by using em's you would enable the site visitors to increase or decrease the font size using their browser. Although modern browsers already support font resizing with px but IE6 and below doesn't.

Another advantage I think is that when designing a page you should set [body{}] in your stylesheet to a fixed font size like [font-size:12px;] and then the rest of your page elements you could use em's this way your default font-size would be 12px but you can increase the size depending on the em's you set.

This is a simple trick I usually implement in the websites I develop.

3 comments:

web said...

There is a lot of competition in outsourcing software development, as there are many firms across the globe catering to clients looking for outsourcing their work. What is good is that the takers can choose the best from the lot. http://www.infysolutions.com.

seo.media said...

Ecommerce and offshore software development are burgeoning trends these days and several India-based offshore software development companies have gained reputation for offering excellent services to the clientele throughout the world. However, it would be extremely advantageous for you to assign your software development project to one of the popular India-based company because services offered by Indian software companies are cost-effective and flexible that ensure future growth and transparency.http://www.eberrymedia.com

merlie said...

Very nice - easy to follow, simple, and working. Thanks for the knowledge!
Pay per click