Adding SWF to a CSS DIV tag

Discussion in 'Web Design and Development' started by thowie, Jan 23, 2009.

  1. thowie macrumors newbie

    Joined:
    Jan 23, 2009
    #1
    I have a website written entirely in CSS format. In following DIV, I want to use a SWF file in place of the JPG. When I try to do this, it doesn't work. PLEASE HELP. How do I get the SWF file in this exactly location with CSS.

    Thanks

    div#ourCompany-bg div#ourCompany-part{
    width:922px;
    margin:0 auto;
    padding:26px 0 28px 0;
    background:url(../images/our-company-bg-pic.jpg) no-repeat 550px 0;
    }
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Only files with a mime type of image can be used as a background image. Your alternative is to use CSS to position an element with the flash in it and place text or whatever content you're wanting over top of it and use z-index to stack accordingly. There can be issues with things not stacking right when using flash though.
     
  3. thowie thread starter macrumors newbie

    Joined:
    Jan 23, 2009
    #3
    BUMMER....essentially how can I do what you mention. I'm new to CSS and the website I'm trying to update (written all in CSS) was inherited to me
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    It all depends on the current CSS and HTML. Here's a simple example though to get you started.

    HTML:
    HTML:
    <div id="myflash">Flash goes here</div>
    <div id="othercontent">Content here</div>
    CSS:
    Code:
    #myflash {
     position: absolute;
     top: 5px; left: 5px;
     width: 600px; height: 400px;
     z-index: 1;
    }
    #othercontent {
     position: absolute;
     top: 5px; left: 5px;
     width: 600px; height: 400px;
     z-index: 2;
    }
    * Just an example though.
     

Share This Page