I managed to accomplish high-contrast with invert css functionallity see (https://css-tricks.com/almanac/properties/f/filter/).
Now I need to see an entire site in black and white, not grayscale. Maybe there's a combination of this functions to make the effect I need? I've already tried contrast(100) grayscale(1); but it affects badly the letters (yo can't read them).
To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.
Use the CSS filter property to convert an image to black and white.
position:absolute You can also use position absolute as well as set all the viewport sides (top, right, bottom, left) to 0px will make the div take the full screen.
Add this grayscale class to your body:
.grayscale-100 {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
filter: grayscale(100%);
}
.colored {
background: yellow;
color: blue;
}
<div class="colored">
This div has a red background and blue font color!
</div>
<div class="grayscale-100">
<div class="colored">
This div has the same style as the above, but its parent has the grayscale class!
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With