开发者

CSS current window size

开发者 https://www.devze.com 2023-03-01 14:12 出处:网络
I am trying some thing like making the background of the whole body part. <html> <head><head/>

I am trying some thing like making the background of the whole body part.

<html>
<head><head/>
<body>
<div class="wrapper"></div>
</body>
</html>

in this case ho开发者_运维百科w do i get the height and width of the current body cause i show a popup other than that i want to blur the whole background.


If you want your wrapper to go full window height and width, you will need to add a few attributes to your html and body elements.

Try something like this:

html {
  height: 100%;
}
body {
  min-height: 100%;
}
.wrapper {
  background: rgba(0,0,0,0.50);
  height: 100%;
  width: 100%;
}


Have you tried

.wrapper {
    height: 100%;
    width: 100%;
    color: black;
    -moz-opacity: .2;
    filter: alpha(opacity=20);
    z-index: 1;
}

or something similar?

0

精彩评论

暂无评论...
验证码 换一张
取 消