I have applied an effect that I want only for a div parent but it applies also to the children.
This is my HTML code:
#wrapper { height: 100%; background-image: url("../asset/banner.jpg"); background-attachment: fixed; background-position: top; background-repeat: no-repeat; background-size: cover; filter: grayscale(100%); } #top-wrapper { width: 100%; height: 10%; background-color: rgba(39, 35, 30, 0.5); } <div id="wrapper"> <header id="top-wrapper" class="inline-content"> <div id="logo" class="inline-content"> <img src="asset/logo.svg" alt="Logo"> <h1>portfolio</h1> </div> <nav> <ul id="menu" class="inline-content"> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Project</a></li> <li><a href="#">Contact</a></li> </ul> </nav> </header> <section id="banner" class="inline-content"> <h2>Hello World!</h2> <h2>and I am a Web Developer</h2> <h3>based in London</h3> </section> </div> The logo is a multi colour logo but it appears in greyscale.
filterapplies to the whole element (including children, so entire page in your case). You might want to trybackground-blend-modeinstead, seems to fit your use case better. But if the point is to make the image grayscale, just save it like that – it will probably save a pretty good portion of it's data size as a bonus.