An alternative practical method to cover flash with div

Source: Internet
Author: User

In this example, the tag of the hyperlink is not used to cover the flash, but it does not matter. Any tag can be used. The key point is: Do not use the tag to wrap the flash, so that the tag and flash are sibling. Then, use the absolute positioning method to locate the flash (you can use the z-index attribute when necessary ). Because positioning is required, it is necessary to convert tag a and flash into a div. Refer to the following code (important code has been marked in red ):

<Div style = "position: relative;">
<A target = "_ blank" href = "http://justinyoung.cnblogs.com/" style = "display: block; width: 200px; height: 50px; position: absolute; left: 0; top: 0; background: transparent url ('/images/toumingtupian.gif') no-repeat; "> </a>

<Object width = "200" height = "50" codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" classid = "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000">
<Param value = "hgjenglsih.swf" name = "movie"/>
<Param value = "high" name = "quality"/>
<Param name = "wmode" value = "opaque"/>
<Embed width = "200" height = "50" type = "application/x-shockwave-flash" pluginspage = "http://www.macromedia.com/go/getflashplayer" quality = "high" src = "hgjenglsih.swf" wmode = ""transparent"
/>
</Object>
</Div>

Tested: IE6-9, Chrome, Firefox, Opera Browser OK!

Add at 10:22:39,: in IE, you can only click the border part of a to check whether a connection is still not allowed. At this time, you only need to add a transparent background image to.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.