SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Possible to set "x-small" font as a specific size?

    Hello,

    I have some html that uses this:

    style="font-size: x-small

    Apparantly, x-small nearly equals 10 pt. when viewed in IE. But it's tiny when viewed from Firefox - probably the equivalent of 8 pt or size="1". Font that small is impossible to read on screens with high resolution, and many of the visitors use Firefox (almost 50% for one our sites!) so this is a problem.

    How do I correct this? It seems like "x-small" is some kind of relative font size...

    Is there any way I can control this so that it appears the same for all browsers?

    (It is not possible to use anything but "x-small" as the font, as it is inserted automatically by the tinyMCE editor used to create the page code.)

    Maybe I can use CSS to specify that "x-small = 10pt" or something like that?

    Thanks for any help.


    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,837
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    If you want a specific size then set a specific size instead of using x-small which leaves it to the browser to decide how big the text should be.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    If you want a specific size then set a specific size instead of using x-small which leaves it to the browser to decide how big the text should be.
    Unfortunately, there is no way to make the editor use anything except x-small.

    Is there no way to use CSS to set a "base size" that x-small is based on?
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  4. #4
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    No. The xx-small to xx-large font sizes are fixed to the user agent, and can't be changed. Also see the specification.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,837
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Sounds like you need to switch to one of the many thousands of other editors that will allow you to do what you need rather than continuing to use the one that doesn't.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I know, the only way would be to ask your users to change their default browser font size to circa 1.44 times the size you want (in pixels).
    Birnam wood is come to Dunsinane


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
  •