DEV Community

Cover image for CSSBattle | #26 Smiley
Nazmuz Shakib Pranto
Nazmuz Shakib Pranto

Posted on

2 1

CSSBattle | #26 Smiley

Welcome to CSSBattle Challenges!

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


Challenge:

Smiley Challenge


Solution:

<div class="container">
  <div class="arc left"></div>
  <div class="arc mid"></div>
  <div class="arc right"></div>
</div>

<style>
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  .container {
    background: #6592CF;
    width: 100vw;
    height: 100vh;
    position: relative;
  }
  .arc {
    position: absolute;
    width: 120px;
    height: 60px;
    border: 20px solid #060F55;
    border-top-left-radius: 100px;
    border-top-right-radius: 100px;
    border-bottom: 0;
    top: 50%;
    left: 50%;
  }
  .left {
    transform: translate(calc(-50% - 100px), calc(-50% - 80px));
  }
  .right {
    transform: translate(calc(-50% + 100px), calc(-50% - 80px));
  }
  .mid {
    transform: translate(-50%, calc(-50% + 80px)) rotate(-180deg);
  }
</style>
Enter fullscreen mode Exit fullscreen mode

Key Takeaway(s):

  • using arc-like shapes with border properties and transparent background

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

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn 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