SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Aug 2006
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    if(el.style.fontSize != "36px" ) { el.style.fontSize = "36px";}

    fontSize will be 36px;
    I wrote this:
    Code:
    <script type="text/javascript">
    window.onload = function() {
    var el = document.getElementById('divid');
    el.style.fontSize = "36px";
    if(el.style.fontSize != "36px" ) { el.style.fontSize = "36px";}
    }
    </script>
    
    <div id="divid">font-size = 36px;</div>
    If I press Ctrl -- , fontSize changes.
    If I press Ctrl ++, fontSize changes.
    I don't want fontSize changes. What can I do?

    I wrote this:
    <div id="divid" style="font-size:36px;">font-size = 36px;</div>
    If I press Ctrl -- , fontSize changes.
    If I press Ctrl ++, fontSize changes.

  2. #2
    SitePoint Zealot the DtTvB's Avatar
    Join Date
    Jul 2006
    Location
    Thailand
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For accessibility, font sizes will always change when you press Ctrl++ and Ctrl+- on Firefox or Opera.

    I don't think it's possible to force browser to render text at the specified size. Some alternatives are using images instead of text. You can use any CSS text replacement techniques... Note that it still won't work on Opera.

  3. #3
    SitePoint Addict
    Join Date
    Aug 2006
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the DtTvB,
    Thanks...
    I will use an image instead of text.


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
  •