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 π€―
β’ β’ β’
Missing some Tweet in this thread? You can try to
force a refresh
In the next 3 minutes, you will be able to tackle CORS errors much more effectively.
CORS is not rocket science.
It's the biggest pain for developers because the majority of us don't know its core concept.
Let's try to build a solid fundamental.
Stands for Cross-Origin Resource Sharing.
It is a security feature implemented by web browsers (almost all) that controls how web pages from one domain can request resources hosted on another domain.