3 June 2005

Power of the unit em

I was posed a problem, and the solution was simpler than the thought process.

Basically, designer wanted a definition lists, but have all the terms the same length, but when text increases to not have them wrap.. and definition to become smaller.

I refused to used tables, but that would not of solved the problem. Then it dawned on me … use em for width.

So after fiddling around … I styled the <dt> as having a width in em, and float: left; then have the <dd> have a margin equal to (or greater) than that width.

See solution »

Try resizing text (smaller or larger)...

 

Comment



note: you can only submit after you hit preview


nuff-respec is a weblog written by daniel bulli a senior web programmer in boston, ma.
more >

contact | resume | profile | twitter

recently :::

diversions :::

45+ Amazing Insect Shots in Photography
Insects are one of the most fascinating creatures on earth. There are more than 800, 000 species of insects in the world.
Grayscale color | Stroep Blog
This is how I create a grayscale color in actionscript 3.
Google Flash API
This is great ... google has made this easy ... stay tuned to see what i am working on ...
25 Free Mac Apps That Will Boost Your Productivity
There are many applications that can help you work faster and efficiently. Though, not many applications come cheap.
you still want more »