7

I am not a CSS expert and I want to make a design that will look good in all browsers and resolutions. I noticed that some websites make their design (width, height, margin, padding) with percentage, not pixels, and I am doing all my design with percentage too. Does this approach have any problems?

Please advise me.

hyrumcoop
  • 362
  • 2
  • 14
Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498

3 Answers3

10

You won't have any problems using this approach, both percentage and pixels work fine depending on your needs. If you need a fluid site, then percentage might be your best option. And ems for the fonts, so the user can modify its display if necessary.

Couple of expert's opinions on this:

https://kyleschaeffer.com/css-font-size-em-vs-px-vs-pt-vs-percent

http://webdesign.about.com/cs/typemeasurements/a/aa042803a.htm

And here's an interesting twist: Percentage + pixels:

http://www.cssplay.co.uk/boxes/outside.html

Community
  • 1
  • 1
Yisela
  • 6,909
  • 5
  • 28
  • 51
2

I guess you should have a look at this:

http://kyleschaeffer.com/best-practices/css-font-size-em-vs-px-vs-pt-vs/

It depends on your needs, I tend to use em instead of pixels or percentages. Also I've noticed that IE does not "eat" percentages too well but ems are working great.

andrei
  • 1,009
  • 11
  • 16
0

To have the site scale depending on the resolution or the size of the browser window, percents will be your best bet. The only problem you may run into is difficulty reading content if the resolution is very low or the size browser window is small, in which case the content may jumble up and make it difficult to read. using percentages rather than pixels will make the site liquid and will adjust according to resolution and scale of the window.

smkelsey
  • 1
  • 1
  • 3