Spice up Your Fonts – Customizing w/ sIFR
Tags: Beginner
I recently worked on a project where I wanted to use sIFR but also wanted to have a background image behind of my headings. I played around with it and found a simple way to get it going. I’m sure this is nothing new to some of you, but for those would like to know, here it is…
What is sIFR?
Scalable Inman Flash Replacement (sIFR) is an open source JavaScript and Adobe Flash based technology that enables the replacement of text elements on HTML web pages with Flash equivalents. It was initially developed by Shaun Inman and improved by Mike Davidson and Mark Wubben.

Check out sIFR Wiki overview of how to install it.
How do you add a background image to sIFR?
First download the sIFR package and edit the following:
index.htm (Javascript at the bottom)
Original Code:
// This is the preferred "named argument" syntax
sIFR.replaceElement(named({sSelector:"body h1", sFlashSrc:"tradegothic.swf", sColor:"#000000", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:20, nPaddingBottom:20, sFlashVars:"textalign=center&offsetTop=6"}));
I basically took out a few elements that I felt was not needed, you can choose leave them in, but what needs to be replaced is the sBgColor: "#FFFFFF" portion to sWmode:"transparent"
Revised Code:
sIFR.replaceElement(named({sSelector:"body h1", sFlashSrc:"hero.swf", sColor:"#ffffff", nPaddingTop:20, nPaddingBottom:20, sFlashVars:"textalign=center", sWmode:"transparent"}));
Properties I modified:
- sFlashSrc:”hero.swf” – New font style I specified using their fla file
- sColor:”#ffffff” – Turned my font color to white
- sBgColor: “#FFFFFF” – Deleted and replaced with sWmode:”transparent”
sIFR-screen.css
Keep in mind, your default h1 still needs to exist for when javascript is turned off or for browsers that cannot support it.
Modify your .sIFR-hasFlash h1 class to the following:
h1 {
font-size: 16px; /*--just an example of your default h1 properties--*/
}
.sIFR-hasFlash h1 {
visibility: hidden;
margin: 0;
height: 45px; /*--Pixel height of your sIFR font--*/
background: #111 url(h1_bg.gif) repeat-x left center;
}
Conclusion
This is just a simple way to add more customization to your sIFR. I’ve run into a few cross-browser issues (especially when browsers have updates) so, do keep up with the latest sIFR versions. If anyone has other cool customization techniques, please share them!
Related Posts
Author Bio
My name is Soh Tanaka and I am a Los Angeles based designer/front-end developer specializing in CSS driven web design with an emphasis on usability and search engine optimization. I also run a CSS Gallery which is updated daily with the best CSS websites from around the world. Come check it out!
You can learn more about me or
Follow me on twitter for more updates and resources!
Did You Enjoy This Post?
Subscribe via RSS or by email to get all upcoming tutorials and articles delivered straight to you.




+ Add Comment10 Peeps Have Spoken Their Minds...
Sme of the browsers in my school’s computer lab don’t have Flash installed. Looking at your demo, I’m not seeing anything beyond the background image. Any way to fix that so we can see the text?
Hey David, unfortunately sIFR relies on flash and javascript enabled browsers~
Take a look at their documentation for more details :-)
http://wiki.novemberborn.net/sifr/What+is+sIFR
PS this tutorial was only to add the background, so for those who are new to this, please do read up on sIFR’s limitations, and how to set it up so users w/ flash and js disabled can still view your site decently~
Unfortunately, It doesn’t work in IE7. I don’t know why :(
Hmm… Thats strange. I’m looking at it now in IE7 and works ok for me. Anyone else with IE7 having issues?
Yeah, its very strange. I’m confused. Now I’m working with some project and using sIFR. Firefox & IE6 work good, but IE7 shows simply text without flash.
P.S. Version of IE: 7.0.5730.13
May be it depends on version of installed flash player? I have the ver. 8.
I have checked it at home (on my home computer) — all works successfully in IE7. Who know which reason of this?
I love sIFR.
Yes it is worked for me on my site in all major browsers.
great example. thx !
Speak Your Mind...