Using Percent or Pixels for width Which is better?

Discussion in 'CSS' started by seattle-west, Dec 20, 2007.

  1. #1
    which one do you guys think personally is better im using percent right now but im finding it harder to code
     
    seattle-west, Dec 20, 2007 IP
  2. Guernica

    Guernica Peon

    Messages:
    268
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Percent, I always use it. I use it because it is universal for all resolution sizes, etc. :)
     
    Guernica, Dec 20, 2007 IP
  3. CypherHackz

    CypherHackz Well-Known Member

    Messages:
    447
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    155
    #3
    i use pixels because i want the website width static for all resolution. if use percent, the width will change according to the resolution and might break website alignment or background images.

    -cypher.
     
    CypherHackz, Dec 20, 2007 IP
  4. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Pixels, so that my website would look the same anywhere. For div widths I use percent sometimes though.
     
    Dondon2d, Dec 20, 2007 IP
  5. buckmajor

    buckmajor Active Member

    Messages:
    574
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Im using pixels cause I dont know yet how to use the percentage correctly ;)
     
    buckmajor, Dec 20, 2007 IP
  6. martinmarzejon

    martinmarzejon Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Percent for text and em for width of divs, etc.
     
    martinmarzejon, Dec 20, 2007 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It's not really the best question to be asking... try something more like, I'm making a page which needs to do this while looking like that-- which measurement is better? Because it depends on what you want it to do and look like.

    Those above who said they used pixels to keep their sites static are using pixels for that purpose-- if you need fluid or flexible sizes, use fluid and flexible measurements.

    This site is limited but may help if you want to try em's instead of % http://riddle.pl/emcalc/

    One thing to watch out for with pixel sizes is when we old people resize the text.... if the boxes can't grow, everything breaks (or, you can make the boxes big enough to do okay for 2-3 text enlargements). Containers in % and em can help in this regard.
     
    Stomme poes, Dec 21, 2007 IP
  8. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #8
    The answer for me is both - for very good reasons...

    CONTENT should always be in a dynamic container with dynamic fonts - either pt or %/em... that way the 20-30% of windows users running large fonts/120dpi aren't diving for the zoom when they hit your page just because you used retardedly small fonts (anything under 12px = /FAIL/ hard). %/em is favored because it lets IE 6.x and earlier users resize text, but PT is eqaully acceptable in my book assuming you follow one simple rule - use fonts big enough in the first damned place.

    BUT, if you have a fixed width, will break the layout if text wraps or overflows, or a fixed height, ESPECIALLY if you have a fixed background-image, that means you should use the same metric - that way at default zoom 'large font/120dpi' users aren't faced with a broken layout because you put a dynamic font over a fixed image.

    IF you do need to resort to a fixed size font - I REALLY recommend against anything below 12px - and frankly I get squirrelly below 14px - as I said above, use fonts big enough in the first damned place if you have to use px or pt... NOBODY ever complained about 24px fonts being too small. People complain about 12px and smaller all the damned time. (which is why I don't understand the phpBB developers raging chodo for 9 and 10px - it's freaking unusable even AT normal resolutions and font settings)

    If you are working with images that cannot slide or scale, px is your only choice... you measure the image behind the text in px, you use px for the fonts - end of story. Sure firefux will resize text like the sweetly retarded crack addict cousing of netscape 3 that it is, but if you use fonts BIG ENOUGH IN THE FIRST PLACE they won't need to dive for the zoom more than one or two notches ...and being Safari doesn't resize content worth shit, and Opera and IE7 handle it brilliantly - close ****ing enough as anyone who actually gives a rats backside about accessability and needs larger font sizes isn't likely to be on Firefux or IE6 in the first place.
     
    deathshadow, Dec 21, 2007 IP