how to css after elements for background overlays

.banner::after {    content: ""; // ::before and ::after both require content    position: absolute;    top: 0;    left: 0;    width: 100%;    height: 100%;    background-image: linear-gradient(120deg, #eaee44, #33d0ff);    opacity: .7;}

4
2
Awgiedawgie 440215 points

                                    .banner::after {    /* opacity: .7; */    mix-blend-mode: color;    mix-blend-mode: hue;    mix-blend-mode: hard-light;}

4 (2 Votes)
0
3.88
8
Krish 100200 points

                                    .banner::before {    transform: skew(-15deg)                translateX(-50%);}

3.88 (8 Votes)
0
4
3
Awgiedawgie 440215 points

                                    .banner {    overflow: hidden;}.banner::after {    content: "";  // :before and :after both require content    position: absolute;    width: 75%; // Makes the overlay smaller to accommodate the skew    height: 100%;    top: 0;    left: 50%; // Push the element 50% of the container's width to the right    transform: skew(15deg) // Puts the element on an angle               translateX(-50%); // Moves the element 50% of its width back to the left    background-image: linear-gradient(120deg,#eaee44,#33d0ff);}

4 (3 Votes)
0
4
5
Awgiedawgie 440215 points

                                    <section class="banner">    <h1>Hello World</h1></section>

4 (5 Votes)
0
4.11
9
Phoenix Logan 186120 points

                                    .banner::after {    opacity: .7;    @supports (mix-blend-mode: hue) {        opacity: 1;        mix-blend-mode: color;        mix-blend-mode: hard-light;        mix-blend-mode: hue;    }}

4.11 (9 Votes)
0
4
1
Awgiedawgie 440215 points

                                    .banner::after, .banner::before {    ...}

4 (1 Votes)
0
4.2
10
Awgiedawgie 440215 points

                                    .banner::after {    ...    z-index: 1;}.banner > * {    z-index: 100;}

4.2 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source