日期:2014-05-19  浏览次数:20634 次

关于html透明层的问题。。。.........................................
不想让里面这层透明该怎样做

HTML code

<html>
    <head>
        <style type="text/css">
            .test {
                position:absolute;
                filter:alpha(opacity=30);
                opacity:0.3;
                background:gray;
                z-index:1;
                width:200px;
                height:150px;
                left:100px;
                top:100px;
            }
            .test1 {
                width:180px;
                height:130px;
                background:white;
                position:absolute;
                left:10px;
                top:10px;
                z-index:100;
            }
        </style>
    </head>
    <body>
        <div class="test">
            <div class="test1">
                不想让里面这层透明,该怎样做?
            </div>
        </div>

        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
    </body>
</html>



------解决方案--------------------
再设置它的透明度为0呢?现在你的设置肯定会透明啊,父层的样式决定了它要透明,内层的样式中设置它的透明度
------解决方案--------------------
可以考虑用style覆盖下
------解决方案--------------------
style="filter: alpha(opacity =90);"调整数字来调整层的透明度。。
------解决方案--------------------
JScript code

<html>
    <head>
    <script src="js/jquery-1.5.1.js"></script>
        <style type="text/css">
            .test {
                position:absolute;
                filter:alpha(opacity=30);
                opacity:0.3;
                background:gray;
                z-index:1;
                width:200px;
                height:150px;
                left:100px;
                top:100px;
            }
            .test1 {
                width:180px;
                height:130px;
                background:white;
                position:absolute;
                left:10px;
                top:10px;
                z-index:100;
            }
        </style>
        <SCRIPT LANGUAGE="JavaScript">
        <!--
            $(function(){
                $('.test1').css({"left":"110px","top":"110px"});
                $('.test1').show()        
            });
        //-->
        </SCRIPT>
    </head>
    <body>
        <div class="test">
           
        </div>
         <div class="test1" style="display:none" >
                不想让里面这层透明,该怎样做?
         </div>
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br/>
        xxx