Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    Okay, I am frustrated with .em font-size settings. Mainly, I am frustrated with the amount to which they cascade. I have read in places that .em is the proper way to size fonts for accessibility reasons because browsers can't resize .px font-size. Every browser I have tested in IS able to resize .px. I think maybe only IE6 and below are not able to. So, if IE6 is the only browser not able to resize px... is it really worth the trouble to use .em?

    Now, why is em frustrating to me?

    Let me show you:

    In my style sheet, if I want to make a general statement for font sizes, such as:
    Code:
    p, li, a { font-size: .8em; }
    Code:
    <p><a href="#">Lorem Ipsum</a></p>
    The rendered text will not be .8em, but instead .64em because the font-size cascades down. (a inherits the font-size from p and then applies its own font-size).

    Because of this, it is much harder to make general font-size statements and instead forces you to have much more style than necessary (meaning, you have to start styling by each specific class... especially if it is a "deep" descendant)

    What are everyone's thoughts on this issue?

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Use pt instead?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    pt should only be used for css print style, not screen.

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Works fine for me, always has. What's wrong with using them?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    Well pt and px are pretty much the same except pt is INTENDED to be used for print styling. I'll post a link later (replying from my phone) about what the four different options (pt, px, em and %) and there differences.

  7. #6
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    One thing to remember with text sizes; em and % are relative to browser text size. Pt and px are relative to monitor res.

    The best thing I have found, that works for me, is to declare a font size in the body tag. I have used all of those at one point or another. I guess you need to ask yourself how many font sizes do you need? I would say for basic text throughout the site, one size would fit. Then you can set sizes for the h tags. This will give you plenty of text size options and reduce the need for extra css and markup. Basically your headings are different sizes and the p, li, a, etc are the same. My last site uses % for everything (my first time trying that) and seems to work great.

    So...
    Code:
    body {
            font-size: 90%;
    }
    h1 {
         font-size:160%;
    }
    h2 {
         font-size: 135%;
    }
    h3 {
         font-size: 120%;
    }
    h4 {
         font-size: 100%;
    }
    For most sites, this will give you everything you need. You don't want a lot of different font sizes anyway. Maybe the footer, which can be

    Code:
    #footer p {
                  font-size: 70%;
    }
    Of course you can use the other size rules too and see which one works best for you. This solution will eliminate your <p><a href...> problem too.

  8. #7
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    Yeah, I understand what em and % vs px and pt are intended for and how they react to browsers/monitor res. % and em are pretty much exactly the same. I was just wondering every ones preference and opinion.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:34 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com