HTML content above transparent FlashThursday 12 Apr 2007 17:02 Today came upon a problem during a site design I was working on. I had some transparent Flash which worked fine, but I couldn't click the HTML menu bar beneath it. The solution I found was to use z-index to layer the HTML content above the Flash. Once I did this I was able to operate my menu bar fine. Below is a quick excerpt from my CSS styles.
#headFlash {
position: absolute;
top: 10px;
text-align: right;
width: 100%;
z-index: 2;
}
#menuBar {
height: 27px;
color: white;
position: absolute;
top: 200px;
left: 20px;
z-index: 3;
}
If you're unsure, z-index allows you to stack content - the z-index value specifying the order. Content with higher z-index values appears above content with lower values. My code still took a bit of tweaking because remember, z-index only works with positioned content (position: absolute;). Fortunately in this case my menu bar and Flash appear early in my content at predictable locations I can specify. If not, I would anchor the content to a known element using Javascript, buts that's code I'll leave for another blog. Tags: html, flash, transparent, css Comments (1) 17 Mar 2008 08:19 by Rishi its not working any more | 16 Dec 2012 Build a Giant Snowman in Minecraft 27 May 2012 I put petrol in my diesel HDi and survived 23 Oct 2011 Minecraft Chicken Grinder (Belle End Farm) 09 Oct 2011 How to Build a Minecraft Piston Mob Grinder 23 Jul 2011 Minecraft Piston Lighthouse 02 Jun 2011 Build a Minecraft Wizard Tower 15 Apr 2011 How to build a hollow sphere in Minecraft 25 Mar 2011 Package for iOS with AIR 2.6 10 Feb 2011 Create 3D Array in Actionscript 3 30 Jan 2011 How to build a Minecraft Mob Grinder 16 Jan 2011 Xbox Kinect distance from TV 05 Dec 2010 Minecraft vs Warcraft |