Pratham Profile picture
I work to place you in the top 1% of web developers β€’ Building https://t.co/TzoPPvXkeN & https://t.co/vTZdsutbrT β€’ DevRel β€’ Prev @Rapid_API @HyperspaceAI

Apr 20, 2021, 25 tweets

Let's create 22 shapes and figures using pure CSS 🎨

πŸ§΅πŸ‘‡πŸ»

1. Circle 🟑

- Pretty simple, we just need to make a square and apply the border-radius 50% in order to give it a circular shape

2. Semi-circle πŸŒ“

- Create a rectangle
- Apply border radius top left and top right same as height of the rectangle

3. Triangle πŸ”Ί

- Creating a triangle is little bit tricky
- Set height and width as zero
- To make this, we draw a solid border and make the side border transparent

4. Trapezium πŸ“

- Same as triangle but in this case we need to set some width

5. Parallelogram πŸ”³

- Create a rectangle
- Apply skew in order to tilt it

6. Hexagon πŸ’ 

- Creating hexagon is very easy
- We need to make two trapeziums of same size but make sure that other trapezium should be upside down
- Align them perfectly

7. Drop πŸ’§

- Create a square
- Apply 50% border-radius to all the sides except one side
- Rotate in such a manner so that tip comes to top

8. Diamond πŸ’Ž

- Combination of Trapezium and triangle

9. Cross ❌

- Create two rectangles
- Place them over each other vetically and horizontally
- Rotate 45deg

10. Egg πŸ₯š

- Using advance border-radius technique

11. Star 🌟

- Create two triangle upside down
- Align second triangle in the middle of the first one

12. Moon 🌜

- Transparent background
- Apply box shadow

13. Coffee β˜•

14. Infinity Symbol ♾️

It may look tough but trust me I created this symbol using border-radius only

15. Arrow ➑️

Combination of rectangle and a triangle

16. Star ⭐

Combination of two triangles

17. Magnifying glass πŸ”

You guessed it right! Its just a simple circle and small rectangle

18. Heart ❀️

- Two rectangles with top round border-radius

19. Pacman

20. 8 Point Star 🌟

Two squares overlapping each other

21. Pentagon βœ’

- Create a trapezium
- Create a triangle
- Merge them both

22. Leaf πŸ€

- Just the matter or border-radius

I hope you will find it helpful, if so, share it ❀️

Peace out πŸ˜‰

In general, these shapes or CSS arts are of no use in practical terms, but

- It can increase your CSS learning process up to 10 times πŸš€
- Helps you build better understanding 🀯

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling