CSS Battle: #7 – Leafy Trail

In this article, I will solve a Leafy Trail CSS Challenge on CSS Battle. Let’s look at the problem first.

Problem

We need to create the following container by using CSS Properties only:

Solution

So now look at the Solution and h…


This content originally appeared on DEV Community and was authored by Jatin Sharma

In this article, I will solve a Leafy Trail CSS Challenge on CSS Battle. Let's look at the problem first.

Problem

We need to create the following container by using CSS Properties only:
Leafy Trail

Solution

So now look at the Solution and how we are going to achieve this.

HTML

<div class="leaf left"></div>
<div class="leaf middle"></div>
<div class="leaf right"></div>

CSS

Now let's style the leaves.

body{
  margin: 0;
  background: #0B2429;
  display: grid;
  place-items: center;
}   
.leaf {
  position: absolute;
  width: 150;
  height: 150;
  border-radius: 100px 0;
} 
.left {
  z-index: 1;
  background: #1A4341;
  margin-left: -100;
}
.middle {
  z-index: 2;
  background: #998235;
} 
.right{
  z-index:3;
  background: #F3AC3C;
  margin-left: 100;
}

Note: In CSS Battle you can use 100 instead of 100px. You don't need to define px in CSS. However, if you are using rem or %, you need to pass them separately. That's why in the above CSS code there are no units mostly. For more info visit here

Minify the code or CSS by using any CSS Minifier. It helps you to reduce the characters in the code which will increase the score.

Codepen

Wrapping up

If you like this then don't forget to ❤️ it. And I'll see you in the next article. See you soon.


This content originally appeared on DEV Community and was authored by Jatin Sharma


Print Share Comment Cite Upload Translate Updates
APA

Jatin Sharma | Sciencx (2022-07-20T04:43:32+00:00) CSS Battle: #7 – Leafy Trail. Retrieved from https://www.scien.cx/2022/07/20/css-battle-7-leafy-trail/

MLA
" » CSS Battle: #7 – Leafy Trail." Jatin Sharma | Sciencx - Wednesday July 20, 2022, https://www.scien.cx/2022/07/20/css-battle-7-leafy-trail/
HARVARD
Jatin Sharma | Sciencx Wednesday July 20, 2022 » CSS Battle: #7 – Leafy Trail., viewed ,<https://www.scien.cx/2022/07/20/css-battle-7-leafy-trail/>
VANCOUVER
Jatin Sharma | Sciencx - » CSS Battle: #7 – Leafy Trail. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/20/css-battle-7-leafy-trail/
CHICAGO
" » CSS Battle: #7 – Leafy Trail." Jatin Sharma | Sciencx - Accessed . https://www.scien.cx/2022/07/20/css-battle-7-leafy-trail/
IEEE
" » CSS Battle: #7 – Leafy Trail." Jatin Sharma | Sciencx [Online]. Available: https://www.scien.cx/2022/07/20/css-battle-7-leafy-trail/. [Accessed: ]
rf:citation
» CSS Battle: #7 – Leafy Trail | Jatin Sharma | Sciencx | https://www.scien.cx/2022/07/20/css-battle-7-leafy-trail/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.