Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在css中模糊背景图像?_Html_Css - Fatal编程技术网

Html 如何在css中模糊背景图像?

Html 如何在css中模糊背景图像?,html,css,Html,Css,我使用过滤器:blur(5px)在body元素中模糊我的背景图像问题不是背景图像,而是div中的我的内容受到影响 文件 身体{ 宽度:自动; 保证金:0; 填充:0; /*背景色:#2E3137*/ 背景图片:url(“images/StockSnap_Q6PIRY9O7M.jpg”); 背景位置:中心; 背景重复:无重复; 背景附件:固定; 背景尺寸:封面; -webkit过滤器:模糊(5px); -moz过滤器:模糊(5px); -o-滤波器:模糊(5px); -ms过滤器:模糊(5p

我使用
过滤器:blur(5px)在body元素中模糊我的背景图像问题不是背景图像,而是div中的我的内容受到影响


文件
身体{
宽度:自动;
保证金:0;
填充:0;
/*背景色:#2E3137*/
背景图片:url(“images/StockSnap_Q6PIRY9O7M.jpg”);
背景位置:中心;
背景重复:无重复;
背景附件:固定;
背景尺寸:封面;
-webkit过滤器:模糊(5px);
-moz过滤器:模糊(5px);
-o-滤波器:模糊(5px);
-ms过滤器:模糊(5px);
过滤器:模糊(5px);
}
@字体{
字体系列:“Roboto”,无衬线;/*稍后使用的名称*/
src:url('https://fonts.googleapis.com/css?family=Roboto“);/*指向字体的URL*/
}
* {
边界塌陷:塌陷;
}
氢{
文本对齐:居中;
}
.集装箱{
宽度:960px;
高度:500px;
保证金:50px自动;
位置:相对位置;
}
.行{
宽度:320px;
位置:绝对位置;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
字体系列:arial;
/*字体大小:13px*/
/*颜色:#e4*/
颜色:白色;
填充:10px 55px 40px;
/*背景:rgba(105,97,82,0.5)*/
/*背景:rgba(20,21,23,0.6)*/
背景:rgb(102105110);
边框:1px纯白;
盒影:0 4px 8px#000000;
边界半径:5px;
字体系列:“Roboto”;
}
输入[类型=文本],[类型=密码]{
宽度:97%;
高度:30px;
左侧填充:5px;
边缘底部:20px;
边缘顶部:8px;
颜色:#4F4F;
字体大小:16px;
}
#登录{
宽度:100%;
边缘顶部:5px;
填充物:5px;
字体大小:粗体;
光标:指针;
/*显示:块;用于居中*/
显示:块;
/*背景色:#DEE9FF*/
}
#报名{
宽度:100%;
边缘顶部:5px;
填充物:5px;
字体大小:粗体;
光标:指针;
}
登录
用户名:

密码:
试试这个

<div class="container">
    <div class="row">
        <h2> Sign In </h1>
        <form action="p1.php" method="POST">
            <?php echo form_errors($errors); ?>
            Username: <br/>
            <input type="text" name="username" /> <br/> 
            Password:  
            <input type="password" name="password" /> <br/>
            <input type="submit" name="submit" id="login"/>
        </form>

        <form action="register.php" method="POST">
            <input type="submit" name="register" value="Create New Account" id="signup"/>
        </form>
    </div>
</div>

body {
        width: auto;
        margin:0;
        padding:0;
        /*background-color: #2E3137; */


    }

    body:before {
        content: '';
        position: fixed;
        width: 100vw;
        height: 100vh;
        background-image: url("https://wallpaperbrowse.com/media/images/background-pictures-2.jpg");
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
          -webkit-filter: blur(5px);
         -moz-filter: blur(5px);
        -o-filter: blur(5px);
        -ms-filter: blur(5px);
         filter: blur(5px);
    }

    @font-face {
        font-family: 'Roboto', sans-serif; /*a name to be used later*/
        src: url('https://fonts.googleapis.com/css?family=Roboto'); /*URL to font*/
    }

    * {
        border-collapse: collapse;
    }

    h2 {
        text-align: center;
    }

    .container {
        width: 960px;
        height: 500px;
        margin: 50px auto;
        position: relative;


    }

    .row {
        width: 320px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); 
        font-family: arial;
        /*font-size: 13px;*/
        /*color: #e4e4e4; */
        color: white; 
        padding: 10px 55px 40px;        
        /*background: rgba(105,97,82,0.5);*/
        /*background: rgba(20,21,23,0.6); */
        background: rgb(102, 105, 110);
        border: 1px solid white;
        box-shadow: 0 4px 8px #000000;
        border-radius: 5px;
        font-family: 'Roboto';

    }

    input[type=text],[type=password] {
        width: 97%;
        height: 30px;
        padding-left: 5px;
        margin-bottom: 20px;
        margin-top: 8px;
        color: #4f4f4f; 
        font-size: 16px;


    }

    #login {
        width: 100%;
        margin-top: 5px;
        padding: 5px;
        font-weight: bold;
        cursor: pointer;
        /* display: block; use for centering  */
        display: block;
        /*background-color: #DEE9FF;*/
    }

    #signup {
        width: 100%;
        margin-top: 5px;
        padding: 5px;
        font-weight: bold;
        cursor: pointer;
    }

登录
用户名:

密码:
身体{ 宽度:自动; 保证金:0; 填充:0; /*背景色:#2E3137*/ } 身体:以前{ 内容:''; 位置:固定; 宽度:100vw; 高度:100vh; 背景图像:url(“https://wallpaperbrowse.com/media/images/background-pictures-2.jpg"); 背景位置:中心; 背景重复:无重复; 背景附件:固定; 背景尺寸:封面; -webkit过滤器:模糊(5px); -moz过滤器:模糊(5px); -o-滤波器:模糊(5px); -ms过滤器:模糊(5px); 过滤器:模糊(5px); } @字体{ 字体系列:“Roboto”,无衬线;/*稍后使用的名称*/ src:url('https://fonts.googleapis.com/css?family=Roboto“);/*指向字体的URL*/ } * { 边界塌陷:塌陷; } 氢{ 文本对齐:居中; } .集装箱{ 宽度:960px; 高度:500px; 保证金:50px自动; 位置:相对位置; } .行{ 宽度:320px; 位置:绝对位置; 最高:50%; 左:50%; 转换:翻译(-50%,-50%); 字体系列:arial; /*字体大小:13px*/ /*颜色:#e4*/ 颜色:白色; 填充:10px 55px 40px; /*背景:rgba(105,97,82,0.5)*/ /*背景:rgba(20,21,23,0.6)*/ 背景:rgb(102105110); 边框:1px纯白; 盒影:0 4px 8px#000000; 边界半径:5px; 字体系列:“Roboto”; } 输入[类型=文本],[类型=密码]{ 宽度:97%; 高度:30px; 左侧填充:5px; 边缘底部:20px; 边缘顶部:8px; 颜色:#4F4F; 字体大小:16px; } #登录{ 宽度:100%; 边缘顶部:5px; 填充物:5px; 字体大小:粗体; 光标:指针; /*显示:块;用于居中*/ 显示:块; /*背景色:#DEE9FF*/ } #报名{ 宽度:100%; 边缘顶部:5px; 填充物:5px; 字体大小:粗体; 光标:指针; }
现场演示-

试试这个

<div class="container">
    <div class="row">
        <h2> Sign In </h1>
        <form action="p1.php" method="POST">
            <?php echo form_errors($errors); ?>
            Username: <br/>
            <input type="text" name="username" /> <br/> 
            Password:  
            <input type="password" name="password" /> <br/>
            <input type="submit" name="submit" id="login"/>
        </form>

        <form action="register.php" method="POST">
            <input type="submit" name="register" value="Create New Account" id="signup"/>
        </form>
    </div>
</div>

body {
        width: auto;
        margin:0;
        padding:0;
        /*background-color: #2E3137; */


    }

    body:before {
        content: '';
        position: fixed;
        width: 100vw;
        height: 100vh;
        background-image: url("https://wallpaperbrowse.com/media/images/background-pictures-2.jpg");
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
          -webkit-filter: blur(5px);
         -moz-filter: blur(5px);
        -o-filter: blur(5px);
        -ms-filter: blur(5px);
         filter: blur(5px);
    }

    @font-face {
        font-family: 'Roboto', sans-serif; /*a name to be used later*/
        src: url('https://fonts.googleapis.com/css?family=Roboto'); /*URL to font*/
    }

    * {
        border-collapse: collapse;
    }

    h2 {
        text-align: center;
    }

    .container {
        width: 960px;
        height: 500px;
        margin: 50px auto;
        position: relative;


    }

    .row {
        width: 320px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); 
        font-family: arial;
        /*font-size: 13px;*/
        /*color: #e4e4e4; */
        color: white; 
        padding: 10px 55px 40px;        
        /*background: rgba(105,97,82,0.5);*/
        /*background: rgba(20,21,23,0.6); */
        background: rgb(102, 105, 110);
        border: 1px solid white;
        box-shadow: 0 4px 8px #000000;
        border-radius: 5px;
        font-family: 'Roboto';

    }

    input[type=text],[type=password] {
        width: 97%;
        height: 30px;
        padding-left: 5px;
        margin-bottom: 20px;
        margin-top: 8px;
        color: #4f4f4f; 
        font-size: 16px;


    }

    #login {
        width: 100%;
        margin-top: 5px;
        padding: 5px;
        font-weight: bold;
        cursor: pointer;
        /* display: block; use for centering  */
        display: block;
        /*background-color: #DEE9FF;*/
    }

    #signup {
        width: 100%;
        margin-top: 5px;
        padding: 5px;
        font-weight: bold;
        cursor: pointer;
    }

登录
用户名:

密码:
身体{ 宽度:自动; 保证金:0; 填充:0; /*背景色:#2E3137*/ } 身体:以前{ 内容:''; 位置:固定; 宽度:100vw; 高度:100vh; 背景图像:url(“https://wallpaperbrowse.com/media/images/background-pictures-2.jpg"); 背景位置:中心; 背景重复:无重复; 背景附件:固定; 背景尺寸:封面; -webkit过滤器:模糊(5px); -moz过滤器:模糊(5px); -o-滤波器:模糊(5px); -ms过滤器:模糊(5px); 过滤器:模糊(5px); } @字体{ 字体系列:“Roboto”,无衬线;/*稍后使用的名称*/ src:url('https://fonts.googleapis.com/css?family=Roboto“);/*指向字体的URL
<!DOCTYPE html>
<html>
<head>
<style>
img {
    -webkit-filter: blur(2px); /* Safari 6.0 - 9.0 */
    filter: blur(2px);
}
</style>
</head>
<body>
<h1>The filter Property</h1>

<p>Apply a blur effect to the image:</p>

<img src="pineapple.jpg" alt="Pineapple" width="300" height="300">



</body>
</html>