CSS Battle: #13 - Totally Triangle

Aug 8, 2022
2 min read
271 words

In this article, I will solve a Totally Triangle CSS Challenge on CSS Battle. Let's look at the problem first.


We need to create the following container by using CSS Properties only: Totally Triangle


So now look at the Solution and how we are going to achieve this.





Now let's style the containers.


* {
  margin: 0;
  background: #0b2429;
p {
  position: fixed;
  width: 200;
  height: 200;
  background: #f3ac3c;
  transform: rotate(45deg);
  left: -100;
  top: -100;
Tip #1

Note: In CSS Battle you can use 100 instead of 100px. You don't need to define px in CSS. However, if you are using rem or %, you need to pass them separately. That's why in the above CSS code there are no units mostly. For more info visit here.

Tip #2

Minify 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:


Alternative Method


body {
  background: linear-gradient(135deg, #f3ac3c 100px, #0b2429 100px);

You can achieve this by using linear-gradient() also which is a lot simpler. You don't even need HTML in this.

Wrapping up

There are many ways to solve this. You can share your approach in the comments. If you like this then you can extend your support by Buying me a Coffee

Jatin's Newsletter

I write monthly Tech, Web Development and chrome extension that will improve your productivity. Trust me, I won't spam you.

Share on Social Media: