SitePoint Sponsor

User Tag List

Results 1 to 22 of 22
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to set "Text Size" to medium?

    I have read that CSS is the only way to set the "Text Size" in the browser to "Medium" from whatever it was already set to. I would still like to us FONT tags, can I use CSS just for the Text Size declaration? If so, how?
    But what care I for praise? - Bob Dylan

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see why you'd need to use any FONT elements at all when CSS is already here and available to use. I also advise against setting absolute font sizes, because it's generally considered poor accessibility to do so. But to each his own, so here ya go:
    Code:
    body { font-size: 13px; }

  3. #3
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Colon, what would you suggest is the best way of setting your font size?

  4. #4
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    body { font-size: 13px; }

    So I can put that code anywhere in the pages and the Text Size will be set to medium? Is there a specific place it needs to be put? I really don't know anything about CSS at all.
    But what care I for praise? - Bob Dylan

  5. #5
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by GrantShady
    body { font-size: 13px; }

    So I can put that code anywhere in the pages and the Text Size will be set to medium? Is there a specific place it needs to be put? I really don't know anything about CSS at all.
    Put this in the head of your document

    <style type="text/css">
    <!--
    body{
    font-size:13px;
    }
    -->
    </style>
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  6. #6
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Nicky
    Colon, what would you suggest is the best way of setting your font size?
    I would definitely use style sheets, but instead of using pixels or even worse, points, I would use font-size keywords. The list is: xx-small, x-small, small, medium, large, x-large, and xx-large. When using a DOCTYPE (strict, or trans + a URL to the DTD), the keyword small will be <font size="2">, which is also 13px.
    Last edited by mattjacob; Mar 31, 2002 at 22:33.

  7. #7
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read over my post, but it sounds really confusing. Tell me if I'm making any sense at all here.

  8. #8
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Makes sense!

    What about using em?

  9. #9
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So should I use "font-size:medium" instead of font-"size:13px" then? Also, I like using font tags because of compatibility with older browsers. Are there currently any downsides to using font tags other than the fact that they are more difficult to update for design changes?
    But what care I for praise? - Bob Dylan

  10. #10
    SitePoint Zealot Tiggy's Avatar
    Join Date
    Mar 2002
    Location
    Lancashire, UK
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've found it impossible to get a single style sheet to behave consistently accross browsers - so I tend to use different style sheets depending on the browser.

    I tend to set the default font-size to x-small for MSIE and Opera, but to small for Mozilla and Netscape 6. The for other font sizes I use percentages so that it will scale with the user's settings if they want to make it more readable.

    The best advice I can give about CSS is you need to allow yourself plenty of time for trial and error... I've just spent a few hours today tweaking my stylesheets - and none of the browsers dealt with list items the same way!

  11. #11
    SitePoint Wizard iTec's Avatar
    Join Date
    May 2001
    Location
    Sydney, Australia
    Posts
    2,243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    interesting but old article on css and font sizes : http://www.alistapart.com/stories/fear4/index.html

  12. #12
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I added:

    <style type="text/css">
    <!--
    body{
    font-size:13px;
    }
    -->
    </style>

    and also tried:

    <style type="text/css">
    <!--
    body{
    font-size:medium;
    }
    -->
    </style>

    inside the head and neither switches my View -> Text Size settings to medium after I placed it on larger. I have noticed that browsing around sometimes my setting will change from medium to larger or something else so there has to be a way to do it. What could I be doing wrong? I have checked the source and the code is in there.
    But what care I for praise? - Bob Dylan

  13. #13
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by GrantShady
    and neither switches my View -> Text Size settings to medium after I placed it on larger
    Good, then your styles are doing what they're supposed to. The application menus are a browser widget, and therefore can't be adjusted. Setting a font size in your style sheet will just physically change the size of the font on the page, but it won't change any settings.

  14. #14
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Nicky
    What about using em?
    Those are fine, because your browser can still adjust the size relative to what is comfortable default viewing for you.

  15. #15
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But, it doesn't change the sizes of the text on the pages at all, even if I choose a large number like 40px to try and see a big change. Do I need to get rid of the font size attributes in the pages?
    But what care I for praise? - Bob Dylan

  16. #16
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All browsers 4.0+ (1998+) implement the text-features of CSS. There is no reason to use <font> tags.

    Sketch
    Aaron Brazell
    Technosailor



  17. #17
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I were to use CSS and specify text size via pixels instead of using font tags would the View -> Text Size setting still alter the size of the text being displayed on the site?
    But what care I for praise? - Bob Dylan

  18. #18
    SitePoint Zealot Tiggy's Avatar
    Join Date
    Mar 2002
    Location
    Lancashire, UK
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, setting your font size to points or pixels will make your text size fixed... unless the user has specifically chosen to over-ride it with their own style sheet.

  19. #19
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tiggy-

    Can a user do that all within a browser with some kind of setting or is it a more involved process?
    But what care I for praise? - Bob Dylan

  20. #20
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you guys are convincing me to redo all the fonts with CSS.

    How difficult is it to learn?

    Is there a specifically good resource on learning it?

    What about browser compatibility? What percentage of users won't be able to view the site properly? What would someone with a pre-4.0 browser see if they viewed a site with fonts via CSS?
    But what care I for praise? - Bob Dylan

  21. #21
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by GrantShady
    Can a user do that all within a browser with some kind of setting or is it a more involved process?
    In Internet Explorer, it's just a matter of adjusting a few settings. Tools> Internet Options...> Accessibility...

  22. #22
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by GrantShady
    How difficult is it to learn?
    Not very. The syntax is quite simple.

    Originally posted by GrantShady
    What about browser compatibility?
    4.0 and below browsers suffer. There's some articles at A List Apart about degrading gracefully -- I suggest you read them.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •