An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
CSS Battle: 16 - Eye of the Tiger
In this article, I will solve a Eye of the Tiger 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 how we are going to achieve this.
HTML
<p c><p l><p r>
<p c>
: Center Circle<p l>
: Left Triangle<p r>
: Right Triangle
CSS
* { margin: 0; background: #0b2429;}body { display: grid; place-items: center;}p { position: absolute }[c] { width: 50; height: 50; border-radius: 1in; border: 45px solid #f3ac3c; box-shadow: 0 0 0 20px #0b2429, 0 0 0 30px #998235; z-index: 1;}[l], [r] { height: 160; width: 82; clip-path: polygon(0 50%, 100% 100%, 100% 0); background: #998235;}[l] { left: 58 }[r] { right: 57; transform: scalex(-1);}
Note: In CSS Battle you can use
100
instead of100px
. You don't need to definepx
in CSS. However, if you are usingrem
or%
, you need to pass them separately. That's why in the above CSS code there are no units mostly. For more info visit hereMinify the code or CSS by using any CSS Minifier. It helps you to reduce the characters in the code which will increase the score.
Minified Version:
<p c><p l><p r><style>*{margin:0;background:#0B2429}body{display:grid;place-items:center}p{position:absolute}[c]{width:50;height:50;border-radius:1in;border:45px solid #F3AC3C;box-shadow:0 0 0 20px #0B2429,0 0 0 30px #998235;z-index:1}[l],[r]{height:160;width:82;clip-path:polygon(0 50%,100% 100%,100% 0);background:#998235}[l]{left:58}[r]{right:57;transform:scalex(-1)}
Jatin Sharma@j471n_Target 16 - Eye of the Tiger at @css_battle
#CSS #webdevelopment #developer #html #design #timelapse #CSSChallenge #developer #web #CSSBattle08:48 AM - 19 Nov 2022
Wrapping up
There are many ways to solve this. You can share your approach in the comments. If you like this then don't forget to it. And I'll see you in the next article. See you soon.
Original Link: https://dev.to/j471n/css-battle-16-eye-of-the-tiger-135d
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To