You only have to specify the height
and width
of the element.
Explanation
As the div
element is empty, by default its height value is auto
so it’ll take the height of the content. By adding the CSS rule forcing the element to have the required height and width it will show the background image as it have a height and width greater than 0.
.fondoIndex {
width: 400px;
height: 400px;
background-image: url("https://upload.wikimedia.org/wikipedia/commons/9/96/Barbados_beach.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
filter: blur(5px);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
</head>
<body>
<div class="fondoIndex"></div>
</body>
</html>