How can I maintain image size while applying a blur effect without shrinking the background?

without blur . with blur I'm new to HTML and CSS. I've been attempting to apply a blur effect to the background images of my divs, but instead of blurring, it seems to shrink them down. How can I achieve the blur without causing this resizing issue?

.parallax {
  /*height: 500px;*/
  height: 100vh;
  font-size: 200%;
  overflow-x: hidden;
  overflow-y: auto;
  perspective: 300px;
  perspective-origin-x: 100%;
}
.parallax .title {
  font-family: 'Lato', sans-serif;
  font-weight: bold;
  color: #424242 black;
  position: absolute;
  left: 50%;
  top: 50%;
  text-align: center;
  transform: translate(-50%, -50%);
}

/* below trying to blur */

.parallax .group2 .back {
  background: #ffdfba;
  background-image: url("image/bubble.png");
  background-size:contain;
  -webkit-filter: blur(5px);
  filter: blur(5px);
  height: 500px;
  height: 100vh;
}
<div class="group group2">
      <div class="layer base">
          <div class="title">
              Blowing Bubbles are fun! They help calm yourself and give you qualities to breath.
          </div>
      </div>
      <div class="layer back">
          <div class="title">

          </div>
      </div>
  </div>

Answer №1

To achieve a full coverage of the div area, you can apply the background-size: cover property to the class .parallax .group2 .back. This will ensure that the background image covers the entirety of the div. I trust this information proves beneficial for your needs.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Display or conceal certain menu items on the Materialize navbar depending on a specified condition

Is there a way to dynamically show/hide the navigation bar depending on the type of user logged in? For example, one user may have access to 4 menu items while another may only have access to 3. Here is an image for reference: https://i.sstatic.net/hCVD3. ...

Having difficulty formatting text alignment using CSS

Is there a way to maintain the alignment of text in the output of the 'About' section even when the content changes dynamically? I want the new line to appear just below 'Lorem', but currently, it shifts below the colon(:). Since the le ...

Switch between hiding and showing the DIV element flaw

I am currently working on a piece of code that involves simple HTML and JS to show/hide elements. Here is the code snippet: // Enabling forEach for 'querySelectorAll' and 'getElementsByClassName' HTMLCollection.prototype.forEach = No ...

Please provide the text to be shown on the button as a parameter

I have created an HTML code that includes a call to an uploader component. <app-uploader [Details]="Details" (onSubmit)="onSubmitEvent($event)"> </app-uploader> The app-uploader component contains the following line: <bu ...

empty area located on the right side of my HTML/CSS website

I'm struggling to figure out why a small white space appears next to my webpage. Inspecting the element shows that the body ends before the space begins, indicating the border is where it should be. As a beginner in HTML and CSS, I hope this issue wil ...

Try utilizing the adjacency selector in Less again

Is it feasible to repeat this pattern an unlimited number of times using Less with the provided CSS selectors? I've been looking into using loops, however, I haven't come across any examples that achieve a similar result. .page-section { ba ...

CSS: Shifting flexbox child to a new row when overflowing

I have a flex row with 2 divs (.box-1 and .box-1) both containing some content. I want them to remain in the same row until the content in .box-1 becomes long enough to push .box-2 to the next line. .box-2 Should have a fixed width on desktop screens. S ...

What techniques can I implement using JavaScript or CSS to create a slightly transparent effect on my text?

I am currently developing a website that features changing background images. I am looking to have the text on the site mimic the color of the backgrounds, but not so much that it becomes difficult to read. How can I make the text transparent in this man ...

The Ajax request encountered a syntax error due to an unexpected token '<'

I have searched the forum extensively for similar questions, but unfortunately haven't found a suitable answer for my specific problem. In my jQuery code, I am attempting to make an AJAX call using the following snippet: function submitForm(formData) ...

Ensure that the logo/header remains fixed at the top of the page at all

Currently, I am facing an issue with keeping my logo/header at the top of the page. I have experimented with CSS properties like position: fixed; z-index: 9999; top: 0; left: 0;, and even tried adjusting the positioning to left: 40%; in an attempt to cente ...

Using Javascript to Swap the Content of an Element

Recently, I've been delving into the world of javascript and have hit a roadblock. I understand how to instruct javascript to set a specific value for an ID, but now I have a new challenge: I want to create javascript code that can retrieve informati ...

Is there a way to modify the color of multiple disabled select fields in Internet Explorer?

After experimenting with various methods to change the color of disabled select items, I found success in Chrome but hit a roadblock in IE. Despite trying ::ms-value, the red color was applied to all disabled select fields, which was not the desired outcom ...

Do you have any ideas for enhancing this CSS?

Is there a more efficient method to select this? Essentially, the <div> has an id of cat1 and contains an <a> element with a matching class of cat1. I am looking for a better way to target the <a> element with the same class name as its ...

Identifying android devices with low resolution

Is there a method to determine if the current user is utilizing a low-resolution device (less than 320px) and then apply a distinct stylesheet specific to that user? ...

HTML code now launches in the existing electron window rather than opening a new window

<html> <head> <title></title> </head> <input type="button" name="new" id="newmon" value="new"> <button onclick="open1()">monitor 1</button&g ...

Steps to eliminate the gap between the link element and toggler in Bootstrap 4

Incorporating the code below will create a navigation bar with a cart icon in Bootstrap 4, indicated by the images. The expanded view showcases the cart next to the search section on the right. When viewed on smaller devices in collapsed mode, it should al ...

Guide on extracting a JavaScript string from a URL using Django

How can I extract "things" from the JavaScript URL "/people/things/" without any unnecessary characters? I've attempted inefficient methods like iteration, but struggle with removing the undesired parts of the string, leading to slow performance. Th ...

Authenticating the Gmail API using a specified user ID

Is there a way to manually input email and password for authentication in the Gmail API without using the default Google popup? I need users to enter their login credentials directly, but I can't figure out how to do it. The code I am currently using ...

How can I detect when an image is loaded in a specific container division using jQuery?

I have a container with multiple images inside, and I would like to capture an event each time an image finishes loading. For example: <div id="container"> <img src="..." /> <img src="..." /> <img src="..." /> ...

What is the best way to align labels and textboxes next to each other when resizing?

I am facing an issue with screen resizing. The code below appears fine on a full screen, but as soon as I resize the window even a tiny bit, it starts to look distorted and unattractive. I have gone through the Bootstrap 4 grid layout tutorial, but it is n ...