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

Analysis of Mysql transaction characteristics and level principles

1. What is a transaction? A database transaction ...

Implementation of CSS scroll bar style settings

webkit scrollbar style reset 1. The scrollbar con...

A brief discussion on MySQL select optimization solution

Table of contents Examples from real life Slow qu...

Simple usage example of vue recursive component

Preface I believe many students are already famil...

Vue easily realizes watermark effect

Preface: Use watermark effect in vue project, you...

Detailed explanation of three ways to import CSS files

There are three ways to introduce CSS: inline sty...

js to write the carousel effect

This article shares the specific code of js to ac...

10 bad habits to avoid in Docker container applications

There is no doubt that containers have become an ...

HTML meta usage examples

Example Usage Copy code The code is as follows: &l...

Java example code to generate random characters

Sample code: import java.util.Random; import java...

How to fix the width of table in ie8 and chrome

When the above settings are used in IE8 and Chrome...

Detailed explanation of Linux DMA interface knowledge points

1. Two types of DMA mapping 1.1. Consistent DMA m...