Javascript 如何使z索引适合页面而不是缩放

Javascript 如何使z索引适合页面而不是缩放,javascript,html,css,svg,z-index,Javascript,Html,Css,Svg,Z Index,如何使z索引适合页面而不是缩放我需要从svg中创建它,但我的svg适合页面 这是我的div代码 <div id="homeScreen" class="grey_box" style="background-color:#CDCDCD; position: absolute; left: 0px; top: 8px; width: 373px; height: 537px; visibility: visible;"> <

如何使z索引适合页面而不是缩放我需要从svg中创建它,但我的svg适合页面

这是我的div代码

<div   id="homeScreen" class="grey_box"  style="background-color:#CDCDCD;
    position: absolute;
    left: 0px;
    top: 8px;
    width: 373px;
    height: 537px;
    visibility: visible;">
 <p class="hello" >E-Number<input id="tags" /></p>
<p class="hello2">Mat-Number<input id="tags1" /><p>
<p class="hello3">Tech. ID<input type="text"  name="fname"><p>
<p class="hello4">RIS<input type="text"  name="fname"><p>
<p class="hello5"> <button onclick="get_action_home()" style="width: 100px">Continue</button><p>
<p class="hello6">Βάση δεδομένων: Τοπικός</p> 
<p class="hello7">Σύνδεση: κομμένη</p> 
<p class="hello8">Κατάσταση βάσης δεδ.: Μη επίκαιρη</p> 

</div>
下面是我从jquery中找到的,但我不知道如何修复它

$(window).resize(function() {
    $("#width").text($(this).width());
    $("#height").text($(this).height());
});
下面是它的功能链接 [连结]()及 这是我换窗户时的坏东西
[link]()

z-index
不适合任何东西,它是一个“分层”工具,允许您将元素放置在彼此的顶部,我想您的意思是您有一个
位置:固定的
位置:绝对的
z-index
结合使用。。如果是这种情况,您可以使用
width:100%使元素适合页面宽度

例如:

<style>
.full_width {
    top:0;
    left:0;
    z-index:1;
    height:20%;
    width:100%;
    position:fixed;
    text-align:center;
}
</style>
</head>
<body>
    <div class="full_width"> i will fit the width of the page</div>

    your other stuff here...
</body>
示例:

好的一个,而这里是不适合页面的错误的一个!
<style>
.full_width {
    top:0;
    left:0;
    z-index:1;
    height:20%;
    width:100%;
    position:fixed;
    text-align:center;
}
</style>
</head>
<body>
    <div class="full_width"> i will fit the width of the page</div>

    your other stuff here...
</body>
<style>
.grey_box {
    width:500px;
    height:600px;
    margin-left:auto;
    margin-right:auto;
    background-color:#CCC;
}
</style>
<div class="grey_box">
 <!-- your content here-->
</div>