www.webdeveloper.com
Results 1 to 4 of 4

Thread: set CSS3 font-face via JS

  1. #1
    Join Date
    Mar 2012
    Location
    Austria
    Posts
    34

    set CSS3 font-face via JS

    Hey everyone,

    how can I set the CSS font-face with url to the font file using Javascript?

    Is there any document, which indicates the correspondig JS commands for the various CSS features?

    Thanks,
    Steve

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,143
    Are you able to create a class in CSS then add the class via JS?

  3. #3
    Join Date
    Mar 2012
    Location
    Austria
    Posts
    34
    would be possbile, but would be a huge effort to change my sourcecode to css classes.

    currently i simply call textelement.style.fontFamily = XY, textelement.style.fontSize = XY and so forth.

    so i hoped that there was something like textelement.style.fontUrl ?

    Thanks,
    Steve

  4. #4
    Join Date
    Mar 2012
    Location
    Austria
    Posts
    34
    however, I guess I need to create a CSS class via JS and then assign it to the particular element - I've spent a couple hours now finding a cross browser solution for that, but i couldn't find anything. can you help me?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles