DEV Community

Cover image for CSSBattle | #31 Equals
Nazmuz Shakib Pranto
Nazmuz Shakib Pranto

Posted on

1

CSSBattle | #31 Equals

Welcome to CSSBattle Challenges!

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


Challenge:

Equals Challenge


Solution:

<div class="container">
  <div class="semi-circle left"></div>
  <div class="semi-circle right"></div>
</div>
<style>
  * {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }
  .container {
    width: 100vw;
    height: 100vh;
    background: #aa445f;
  }
  .semi-circle {
    width: 200px;
    height: 100px;
    border-top-right-radius: 100px;
    border-top-left-radius: 100px;
    position: absolute;
    top: 50%;
    left: 50%;
  }
  .right {
    background: #e38f66;
    transform: translate(calc(-50% + 75px), -50%) rotate(90deg);
  }
  .left {
    background: #f7ec7d;
    transform: translate(calc(-50% - 75px), -50%) rotate(-90deg);
  }
</style>
Enter fullscreen mode Exit fullscreen mode

Key Takeaway(s):

  • create semi-circles with height half the size of the width along with border radius properties
  • use multiple transform properties to shift or rotate an element in multiple ways

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

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (2)

Collapse
 
hustlenomics916 profile image
nerdom

Could you automate Target circle app coupon adding?

Collapse
 
npranto profile image
Nazmuz Shakib Pranto

On it lol

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