iframe標簽里面的頁面元素只讀


iframe標簽里面的頁面元素只讀,可以通過設置一個只讀的透明div進行遮罩實現。

html代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style>
    .mask
    {
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 1;
        filter: alpha(opacity=0);
        opacity: 0;
        background: #ffffff;
    }
</style>
<div style="position: relative">
    <div class="mask">
    </div>
    <iframe src="http://bbs.csdn.net" width="500px" height="300px" id="ifr"></iframe>
</div>

效果:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM