【问题标题】:css blur technique only for the background [duplicate]仅适用于背景的CSS模糊技术[重复]
【发布时间】:2015-08-29 17:29:33
【问题描述】:

我想使用 css3 过滤器模糊此 html 代码的背景图像,请提供解释。

    <!DOCTYPE html>
<html>
<head>
    <title>Student-login</title>
    <link href='http://fonts.googleapis.com/css?family=Slabo+27px' rel='stylesheet' type='text/css'>
    <style>
        body{

            background-image: url("background.jpg");
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center;
            background-attachment: fixed;
        }

    </style>
</head>
<body>
    <div class="main-form">
    <h1>Hello</h1>
    </div>
</body>
</html>

但是这里面的内容不会模糊。

【问题讨论】:

  • 为什么不直接使用已经模糊的图像?
  • 你想如何模糊任何东西?
  • 因为 css3 可以选择模糊任何不模糊的图像。使用 Photoshop 使每张图片模糊太麻烦我猜@Matt Ball
  • link@j08691
  • 我投票结束这个问题作为离题,因为 OP 没有提供任何解决他的问题的尝试

标签: css


【解决方案1】:

你必须使用两个不同的容器,看看这里会对你有所帮助:

https://stackoverflow.com/a/20039965/4298050

【讨论】:

  • 它说必须有两个容器我可以使用一个容器作为主体,另一个作为 div 吗? @萨米尔
  • 如果你在 body 上加上一个模糊,你所有的内容都会被模糊,我认为最好的解决方案是制作一个不兼容任何东西的 div,除了模糊元素,另一个包含你的内容的正常 @Ethereal灵魂
猜你喜欢
  • 2016-11-16
  • 2020-08-31
  • 1970-01-01
  • 2018-01-29
  • 1970-01-01
  • 2018-12-17
  • 2021-10-22
  • 2015-08-28
  • 1970-01-01
相关资源
最近更新 更多