DEV Community

Nazmuz Shakib Pranto
Nazmuz Shakib Pranto

Posted on

2 1

CSSBattle | #22 Cloud

Welcome to CSSBattle Challenges!

In this short article, I go through my solution for CSSBattle - #22 Cloud challenge. Please refer to the code snippet below to get a better insight into my thought processes and the implementation detail.


Challenge:

Cloud Challenge


Solution:



<div class="container">
    <div class="left-circle circle bg-orange"></div>
    <div class="bottom-rect bg-orange"></div>
    <div class="right-circle circle bg-orange"></div>
</div>

<style>
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  .bg-orange {
    background: #D86F45;
  }
  .circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }
  .container {
    background: #F5D6B4;
    width: 100vw;
    height: 100vh;
    position: relative;
  }
  .left-circle, .bottom-rect, .right-circle {
    position: absolute;
    left: 50%;
    top: 50%;
  }
  .left-circle {
    transform: translate(-100px, -35px);
  }
  .bottom-rect {
    transform: translate(-75px, 15px);
    width: 175px;
    height: 50px;
    border-top-left-radius: 50px;
    border-top-right-radius: 50px;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
  }
  .right-circle {
    transform: translate(-20px, -65px);
  }
</style>


Enter fullscreen mode Exit fullscreen mode

Key Takeaway(s):

  • breaking down a complicated shape into smaller, easily reproducible chunks
  • feel free to use position absolute to place elements relative to each other

As always, I welcome any feedback or questions regarding the implementation detail of the challenge. Otherwise, I hope this was useful!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay