A quick question

Discussion in 'HTML' started by Kate, Feb 14, 2005.

  1. Kate

    Kate Guest

    I was just wondering which is better to use in my css px, pt or em?

    Many thanks in advance,
    Kate
    Kate, Feb 14, 2005
    #1
    1. Advertising

  2. Kate wrote:

    > I was just wondering which is better to use in my css px, pt or em?


    Percentages.

    body { font-size: 100%; }
    h1 { font-size: 140%; }
    h2 { font-size: 130%; }
    td { font-size: 100%; }
    ..legalese, .copyright { font-size: 90%; }
    and so on...

    Using em causes problems with Internet Explorer. Using px or pt means
    that IE users cannot resize your text should the person have vision
    problems and need larger text.

    --
    -bts
    -This space intentionally left blank.
    Beauregard T. Shagnasty, Feb 14, 2005
    #2
    1. Advertising

  3. On Mon, 14 Feb 2005 16:57:36 -0000, Kate <> wrote:

    > I was just wondering which is better to use in my css px, pt or em?
    >


    Those are units to define a length value for a proporty for a selector in
    CSS. Fully depends on what selector (perhaps combined with what property).

    For example, I use:

    em for sizes of boxes;
    px for sizes of borders (mostly) --> Always a bad idea for font size
    (Google for tons of posts with the reasons);
    pt --> never (I see no point ;-) . pt is nice on paper, not in screen
    media IMO);
    % just when it seems appropriate if selector needs to have a dimention
    that is % of parent.

    See? So what length are you needing? What selector? What property?

    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Feb 14, 2005
    #3
  4. Kate

    Kate Guest

    "Barbara de Zoete" <> wrote in message
    news:eek:psl65tf0yx5vgts@zoete_b...
    > On Mon, 14 Feb 2005 16:57:36 -0000, Kate <> wrote:
    >
    > > I was just wondering which is better to use in my css px, pt or em?
    > >

    >
    > Those are units to define a length value for a proporty for a selector in
    > CSS. Fully depends on what selector (perhaps combined with what property).
    >
    > For example, I use:
    >
    > em for sizes of boxes;
    > px for sizes of borders (mostly) --> Always a bad idea for font size
    > (Google for tons of posts with the reasons);
    > pt --> never (I see no point ;-) . pt is nice on paper, not in screen
    > media IMO);
    > % just when it seems appropriate if selector needs to have a dimention
    > that is % of parent.
    >
    > See? So what length are you needing? What selector? What property?


    :) Everything that both yourself and Beauregard mentioned. I was unsure
    as to which I should use for which.

    i.e.:
    Text, Position, Widths, Borders you get the idea. I have read so many
    conflicting p.o.v. That I became more confused than when I first started
    looking into it.

    Kate
    Kate, Feb 14, 2005
    #4
  5. On Mon, 14 Feb 2005 17:13:15 -0000, Kate <> wrote:

    > "Barbara de Zoete" <> wrote in message
    > news:eek:psl65tf0yx5vgts@zoete_b...
    >
    >> On Mon, 14 Feb 2005 16:57:36 -0000, Kate <> wrote:
    >>
    >>> I was just wondering which is better to use in my css px, pt or em?
    >>>

    >>
    >> Those are units to define a length value for a proporty for a selector
    >> in CSS. Fully depends on what selector (perhaps combined with what
    >> property).
    >>

    < snipped examples >

    >> See? So what length are you needing? What selector? What property?

    >
    > :) Everything that both yourself and Beauregard mentioned. I was
    > unsure as to which I should use for which.
    >
    > i.e.:
    > Text, Position, Widths, Borders you get the idea. I have read so many
    > conflicting p.o.v. That I became more confused than when I first started
    > looking into it.
    >


    I see. Well, all starts with the design concept. If you go for fluid or
    liquid (see <http://www.google.com/search?q=liquid+design>), you will love
    proportional units for just about everything. If you use proportional
    units (like em and %), your pages' design will adapt to any screensize and
    zoom ration by adjusting all parts relatively to eachother.
    If you need something to be fixed, go with px. But please do not use them
    for font size, for reasons Beauregard mentioned.

    Was this of any help at all?


    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Feb 14, 2005
    #5
  6. Kate

    Kate Guest

    "Barbara de Zoete" <> wrote in message
    news:eek:psl66heg8x5vgts@zoete_b...
    > On Mon, 14 Feb 2005 17:13:15 -0000, Kate <> wrote:
    >
    > >>
    > >>> I was just wondering which is better to use in my css px, pt or em?
    > >>>
    > >>
    > >> Those are units to define a length value for a proporty for a selector
    > >> in CSS. Fully depends on what selector (perhaps combined with what
    > >> property).
    > >>

    > < snipped examples >
    >
    > >> See? So what length are you needing? What selector? What property?

    > >
    > > :) Everything that both yourself and Beauregard mentioned. I was
    > > unsure as to which I should use for which.
    > >
    > > i.e.:
    > > Text, Position, Widths, Borders you get the idea. I have read so many
    > > conflicting p.o.v. That I became more confused than when I first

    started
    > > looking into it.
    > >

    >
    > I see. Well, all starts with the design concept. If you go for fluid or
    > liquid (see <http://www.google.com/search?q=liquid+design>), you will love
    > proportional units for just about everything. If you use proportional
    > units (like em and %), your pages' design will adapt to any screensize and
    > zoom ration by adjusting all parts relatively to eachother.
    > If you need something to be fixed, go with px. But please do not use them
    > for font size, for reasons Beauregard mentioned.
    >
    > Was this of any help at all?


    Yes it's a great help. Many.... many thanks Barbara and Beauregard. Like
    they say the internet is very useful tool, if you know where to look. But
    it can also be unhelpful when you get a list of 200 sites, and then you need
    to figure out who actually knows what they are talking about.

    Have a great week,
    Best regards Kate.
    Kate, Feb 14, 2005
    #6
  7. Kate

    Steve Pugh Guest

    "Kate" <> wrote:

    >I was just wondering which is better to use in my css px, pt or em?


    Use them for what?

    px are great for things that are intrinsically sized in pixels -
    images for example. They're also useful for things like borders (only
    the most hard core flexible design purist would insist on using em or
    % for borders - though with some layouts using % is a boon as you can
    then add everyhing up)

    pt are great, in theory, for print stylesheets but unless you know the
    paper size, etc. to be used print is actually only slightly more
    restricted than screen. pt and the other physical units (pica, in, cm,
    mm) are best used when you know the exact characteristics of the
    output medium - e.g. a kiosk display.

    em are useful for things that are best made flexble based on the font
    size, so many paddings and margins are best specified in em.

    You didn't mention % which is possibly the most useful length unit.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Feb 14, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jack
    Replies:
    1
    Views:
    889
  2. jack

    Quick perl question 2

    jack, Aug 25, 2003, in forum: Perl
    Replies:
    1
    Views:
    893
  3. Jorell

    Quick Question

    Jorell, Aug 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    304
    Jorell
    Aug 8, 2003
  4. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Quick Question - Newby Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Feb 14, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    637
    Iain Norman
    Feb 16, 2005
  5. JKop
    Replies:
    11
    Views:
    856
Loading...

Share This Page