I use CSS quite a bit now, but some times I just can't place things where I want them inside the "wrapper".
Tables are easy, but make for very ugly code.
Are percenatges in CSS the way to go or should you now make tables using CSS?
Is there one way where everything doesn't change in a different browser?

8 Years
Discussion Span
Last Post by diafol

Leave the tables for data.

Percentages usually work well for fluid/liquid sites. If you want your site to look exactly the same in all resolutions, including people having to scroll on smaller screens or getting lost in humungous screens, use pixels. This does not mean that %ages are the best way to go. In fact sites can look really silly when stretched to infinity on a superwide monitor. In fact you can mix 'n' match, % for some elements, static pixel dimensions for others.

The use of max-width/min-width/max-height/min-height has been the saviour of many a fluid design. These can act as constraints to avoid the ridiculous dimensions forced by both massive and tiny screens.

'em' is another measurement that you may want to look at. Very useful for fluid sites - e.g. text sizing.

If you search forums you'll probably come across heated debates wrt %/px/em/pt dimensions and fluid/fixed layouts. My answer is design the one you like. All have advantages and disadvantages. I create fluid/fixed/custom mixtures and use a variety of %/em/px. I usually avoid pt - sometimes use this in print only css files, but very rarely.

WRT browser differences. Alas there will always be browser differences. Probably 98% less is you take IE6 out of the equation.

Edited by diafol: n/a


Thank you very much for the great info!
I have used a mixture, or should I say do, but didn't know if that would be a bad pratice.


Good man. Carry on. Half the fun of what we do is experimentation. If nobody tried to do things differently, we'd still be looking at inline width attributes. Although, come to think of it, you can use % or px (without the px suffix) there too. Anyway, seeing css inconsistencies across browsers can be a pain, but working through a solution is a buzz. Okay, gonna stop there, I sound like a geek.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.