Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Font Sizing with CSS

    I am working with a piece of code where there is a tag specifying font size (font size=2). Is there any way to accomplish precisely the equivalent in CSS?

    G

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    font-size: 10pt;

    redhead

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Redhead. I have tried that, but pt gives you a fixed size, so that if you go into your browser and adjust the font size (larger, medium, etc), the font size stays fixed. That is a nice way to go and I prefer it, but I am trying to replicate the size and effect of size=2, which does adjust when the viewer makes the browser text size adjustment.

    G

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Ames, IA, USA
    Posts
    373
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe using one of these:

    xx-small, x-small, small, medium, large, x-large, xx-large

    would do what you're looking for.
    Need more emoticons?
    Visit Catman's Private Stock

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't forget that the css spec also allows the use of percentages as well as larger and smaller for relative sizing.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, Catman, and Roy, yes, those are good ideas. I will experiment with them. Thanks.

    G

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Looks like x-small in the arial typeface is about equivalent to +2, if am looking at this right.

    G

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You'll see that the list Catman posted has exactly 7 sizes listed which should correspond to the seven sizes used by the font tag.

  • #9
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    you can also use percentages, which is what i do. it gives you more control over the size of the font, but allows the user to resize them.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #10
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, percentages and ems gives the user control over the font size, and to a lesser extent, so does the keyworded sizes. However, those seven keyworded sizes does not represent the seven sizes of the font tag. That is evident by that medium, being the fourth of the keyworded sizes, is the standard size, while 3 is the standard size of the font tag. Thus, you have to be careful with those.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

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