Example code for implementing background blur effect with CSS

Example code for implementing background blur effect with CSS

Is it the effect below? If so, please continue reading!

insert image description here

Code demonstration (taking the above picture as an example)

Write out the main modules and omit the codes for other details.

HTML code:

 <div class="login-container">
     //This div is the background image <div class="beijing"></div>
     //This div is the displayed content block, which is my logo and login box <div class="content"></div>
  </div>

CSS code:

 .login-container{
    position: relative;
    width: 100%;
    height:100%;
    position: relative;
    //Use flex layout to vertically center the content module display: flex;
    flex-direction: column;
    position: relative; 
  }
 .beijing{ //Background image style width: 100%;
    height: 100%;
    position: absolute;
    left: 0px;
    top:0px;
    background: url('../../../static/img/timg (1).jpg');
    background-repeat: no-repeat;
    background-size: cover;
    -webkit-filter: blur(10px);
    -moz-filter:blur(10px);
    -o-filter: blur(10px);
    -ms-filter:blur(10px);
    filter: blur(10px);
  }
.content{ //Content image style width: 80%;
	height: 70%;
	position: absolute;
	z-index: 5;
}

By following the HTML and CSS above, you can achieve the background blur effect you want!

Summarize

This concludes this article about sample code for implementing background blur effect with CSS. For more CSS background blur content, please search previous articles on 123WORDPRESS.COM or continue browsing the related articles below. I hope you will support 123WORDPRESS.COM in the future!

<<:  Detailed explanation of the relationship between image format and design in web design

>>:  SQL implementation LeetCode (185. Top three highest salaries in the department)

Recommend

Complete steps for Nginx to configure anti-hotlinking

need: Usually, sites want to prevent videos and p...

Detailed explanation of incompatible changes of components in vue3

Table of contents Functional Components How to wr...

Detailed explanation of vue.js dynamic components

:is dynamic component Use v-bind:is="compone...

Mysql case analysis of transaction isolation level

Table of contents 1. Theory SERIALIZABLE REPEATAB...

How to customize Docker images using Dockerfile

Customizing images using Dockerfile Image customi...

JavaScript custom calendar effect

This article shares the specific code of JavaScri...

Django2.* + Mysql5.7 development environment integration tutorial diagram

environment: MAC_OS 10.12 Python 3.6 mysql 5.7.25...

Cross-browser development experience summary (I) HTML tags

Add a DOCTYPE to the page Since different browser...

Why MySQL does not recommend using subqueries and joins

To do a paginated query: 1. For MySQL, it is not ...

Web designer's growth experience

<br />First of all, I have to state that I a...