Using a SWF as a Background Image

This is not a recommend practice, but it is possible to use a SWF as a background in place of an image. Simply merge the instructions for placing HTML content above a SWF with the instructions for scaling your SWF to 100% of the browser's width and height.

Working (but ugly) example using "exactFit": dynamic publishing.


  • Tested successfully on Mac (Safari 4, FF3.6, Opera 10 & 10.5, Chrome) and Windows XP (IE6, FF3.5, Safari 4, Chrome)
  • The HTML content will need to be placed in a container element, such as a <div> in order to position it using CSS.
  • This example does not take into account what will happen if SWFObject is not successfully embedded — the page will become unusable because the CSS assumes the SWF will be successfully embedded.
  • You can use noScale instead of exactFit if you prefer; this was just a quick example.
  • You can use static publishing instead of dynamic publishing if you prefer.

Questions or Comments?

If you have questions or would like to point out an error, please post your remarks in the SWFObject Google Group. Thanks!