2

I've been using pixel defined width and height dimensions for my HTML elements so far. This works out pretty fine except when you're faced with bigger screens. What are the pros and cons of using percentages as your standard?

P.S.Also how do you handle the size of fonts?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Sussagittikasusa
  • 2,525
  • 9
  • 33
  • 47

3 Answers3

1

Good article to read on this topic. Fixed Vs Fluid Vs Elastic layouts

Chinmayee G
  • 7,947
  • 2
  • 31
  • 41
  • This was an interesting read. I have starting using ems instead of fixed layouts lately, and it can be helpful. A good practice, in my opinion, is using em and add "+/-" buttons. This approach would just increase the font-size on the body tag, which in turn, will act as a zoom feature that works on all browsers. (As long as all sizes are set in em of course) – Dan Dec 20 '10 at 10:03
1

Pros

  1. It is the easiest way to the same height.
  2. It avoids using float or position:absolute for purposes for which they were not intended.
  3. It provides a simple way for beginners to produce side by side layouts in CSS without polluting their HTML with non-semantic tags.

Cons

  1. It doesn't work in IE7 and earlier and so you either need to define a different layout for those browsers or mess around with floats or position:absolutes to produce CSS for those browsers which works equally well in other browsers anyway.
  2. To create a colspan or rowspan effect requires nesting one table inside another.
  3. It encourages people to build grid layouts rather than taking a more flexible approach.
Pratik
  • 11,534
  • 22
  • 69
  • 99
0

If you've defined maximum and minimum heights, there aren't many disadvantages other than the constant worry that if your new posted content will look good on every resolution. And there is still the problem of percentage rounding and overlapping margins... Stubbornella is known to find solutions to the most of the problems that come with flexible layouts (see the demo page) and also there is this The Perfect 3 Column Liquid Layout by Matthew James Taylor.

Ege Özcan
  • 13,971
  • 2
  • 30
  • 51