11 Tweets 1 reads Mar 15, 2023
5 Practical CSS tips you can apply today ✨
Use :πšπš’πš›πšœπš-πš•πšŽπšπšπšŽπš› to drop the first letter of the text.
πš™:πšπš’πš›πšœπš-πš•πšŽπšπšπšŽπš› {
πšπš˜πš—πš-πšœπš’πš£πšŽ: 𝟸00%;
πšŒπš˜πš•πš˜πš›: #πŸΎπ™°πŸΈπ™±π™΄πŸΈ;
}
The :πšπš’πš›πšœπš-πš•πšŽπšπšπšŽπš› selector is used to specify the style of the first letter of an element; it only applies to block-level elements.
Image text wrapping
β€œShape-outside” is a CSS property that allows setting shapes. It also helps define areas where text flows
Simplify code with :πš πš‘πšŽπš›πšŽ()
When applying the same style to multiple elements, the CSS might look like this:
.πš™πšŠπšπšŽ πšπš’πšŸ,
.πš™πšŠπšπšŽπš .πšπš’πšπš•πšŽ,
.πš™πšŠπšπšŽ #πšŠπš›πšπš’πšŒπš•πšŽ {
πšŒπš˜πš•πš˜πš›: πš›πšŽπš;
}
This code doesn’t look very readable, and the :πš πš‘πšŽπš›πšŽ() pseudo-class comes in handy. The :πš πš‘πšŽπš›πšŽ() pseudo-class function accepts a selector list as its argument and will select all elements that can be selected by any rule in the selector list.
The above code can be written like this using :πš πš‘πšŽπš›πšŽ()
.πš™πšŠπšπšŽ :πš πš‘πšŽπš›πšŽ(πšπš’πšŸ, .πšπš’πšπš•πšŽ, #πšŠπš›πšπš’πšŒπš•πšŽ) {
πšŒπš˜πš•πš˜πš›: πš›πšŽπš;
}
Shadow for transparent images
The solution to adding shadow effects for transparent images is to use πšπš›πš˜πš™-πšœπš‘πšŠπšπš˜πš .
The way it works is that the πšπš›πš˜πš™-πšœπš‘πšŠπšπš˜πš  property follows the alpha channels of the given image. As such, the shadow is based on the shape inside the image rather than being displayed outside of it.
Typing effect for text
Web designs are getting more creative by the minute. And with the help of CSS animation features, you can make your web pages feel alive. You can use such animations and `@πš”πšŽπš’πšπš›πšŠπš–πšŽπšœ` properties to achieve a typewriter effect.
That's a wrap!
If you enjoyed this thread:
1. Follow me @codedamncom for more of these
2. RT the tweet below to share this thread with your audience

Loading suggestions...