Jump to content

gradient blur in css?

Recommended Posts

Posted

Site URL: https://jonpxl.com

I'm trying to make an image have a blur gradient across it, so that text is more legible. I prefer to do this in CSS as the image and text layout is a little different depending on different devices used.

I can't seem to get it to work as a gradient. Also is there a way to have the blur go to the edges & corners?

I am also using a colour gradient. 

password: dolphin267

 

My current code:

#intro .Index-page-image {
  filter: blur(14px); 
}

#intro .Index-page-image:after {
    background: linear-gradient(
   to right, 
   rgba(0,0,0,.5) 0%,
   rgba(0,0,0,0) 40%) !important;
    filter: opacity(1);
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

 

  • Replies 2
  • Views 3.3k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted

Hi,

use this new code

section#intro:after {
    background: linear-gradient(
   to right, 
   rgba(0,0,0,.5) 0%,
   rgba(0,0,0,0) 40%) !important;
    filter: opacity(1);
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.