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

A solution to the abnormal exit of Tomcat caused by semaphore

I'm playing with big data recently. A friend ...

Deploy grafana+prometheus configuration using docker

docker-compose-monitor.yml version: '2' n...

A simple way to build a Docker environment

First, let’s understand what Docker is? Docker is...

Docker swarm simple tutorial

swarm three virtual machines 132,133,134 1. Initi...

Detailed explanation of desktop application using Vue3 and Electron

Table of contents Vue CLI builds a Vue project Vu...

Mysql 5.6.37 winx64 installation dual version mysql notes

If MySQL version 5.0 already exists on the machin...

A brief discussion on JS packaging objects

Table of contents Overview definition Instance Me...

Detailed explanation of CSS3 elastic expansion box

use Flexible boxes play a vital role in front-end...

CSS style does not work (the most complete solution summary in history)

When we write pages, we sometimes find that the C...

JavaScript deshaking and throttling examples

Table of contents Stabilization Throttling: Anti-...

Simple usage of MySQL temporary tables

MySQL temporary tables are very useful when we ne...

Docker solution for logging in without root privileges

When you use the docker command for the first tim...

Detailed explanation of how to view the current number of MySQL connections

1. View the detailed information of all current c...