DEV Community

Discussion on: CSS Battle: #12 - Wiggly Moustache

Collapse
 
j471n profile image
Jatin Sharma

What's in?

in stands for inches (1in === 96px). Its an absolute CSS unit. You can learn more about that here

I hope your HTML and name classes would be more descriptive. It would be easier to read.

In this article, I have <p l> for left semi circle and l is the class in short form (you don't need to pass class attribute in CSS Battle). In normal CSS we style the CSS like this:

.left {
    /* Some Styles */
}
Enter fullscreen mode Exit fullscreen mode

CSS Battle allows you to directly use that by simply using brackets [] like this:

[left] {
    /* Some Styles */
}
Enter fullscreen mode Exit fullscreen mode

In my code, I try to keep everything short to get higher score. My code will only work in CSS Battle as it uses some special keywords provided by CSS Battle. However, it will work in other browsers or Codepens after some alteration the code.

For me it was hard to figure out how to make the rounded tips on the left and right.

You can simply create a circular ball with the same width and height, then position it according to the container and then let the box-shadow do the magic. Following is the example (play with values):

.dot {
  width: 20px;
  height: 20px;
  background: #d86f45;
  border-radius: 1in;
  position: absolute;
  left: 70px;
  bottom: 124px;
  box-shadow: 240px 0 #d86f45;
}
Enter fullscreen mode Exit fullscreen mode

I recommend you to take a look at CSS Battle Tips & Tricks. So, you don't get lost in the future articles.