🎨 Introduction
In this post, I am going to tell you about some really cool CSS tricks that you could use in everyday designing. I will explain how to use them and more.
For those who don’t know what CSS is, it is a powerful styling language that can transform boring and static HTML pages into masterpieces of design and substance.
🔹 The Properties:
1) writing-mode
This property allows developers to define the directionality of text and its flow within a container. It has several properties like horizontal-tb (text flows from the top of the container to the bottom), vertical-rl (text flows from the right of the container to the left), and vertical-lr (text flows from the left of the container to the right).
Here, since I have used vertical-lr, the text has not only become vertical but it also flows from left to right of the container.
Similarly, here I have used vertical-rl, so the text flows from right to the left of the container. You can use this property for styling pictures like the one below and much more.
2) resize
Have you ever wished that you could maybe use the functionality of resizing of the textarea tag for other elements? Well, guess what, you can do that just using two CSS properties. When you set a resize:both property to any element along with overflow: auto, you can resize that element just the way you would a textarea. You could also set resize to horizontal or vertical, and that would allow the users to resize the width or height of the container respectively.
3) background-clip
Background-clip is a really fun and easy way to apply gradients to texts. Using this property, you can apply different gradient backgrounds to texts, making them look stunning. For example, you could do something like this by using background-clip:text
4) Scroll-behavior
Have you ever wondered that when you are jumping from one portion of the page to the other using links, your page moves very weirdly? If that’s the case, then you are probably not using a CSS property called scroll-behavior. The scroll-behavior property specifies whether to smoothly animate the scroll position, instead of a straight jump, when the user clicks on a link within a scrollable box. Setting the scroll-behavior to smooth ensures a very smooth animated “scroll effect” between elements within a scrolling box.
So, there you have it! These CSS tricks are just a glimpse into the endless possibilities that await you in the world of web design. Stay tuned for more tips and tricks to elevate your design game.
Happy coding! 🚀
Source: hashnode.com