Try this the next time when you are placing an icon next to some text in CSS.
Instead of using the em unit to make the icon the same size as the text, try using the cap unit 🤩
1em is equal to the font size, which is not a direct measurement of the height of the letters
However, 1cap is the size of a capital letter of the font, which helps to neatly align the icon with the text.
⚠️ You may also need flex and align baseline to achieve an alignment as demonstrated above!
Please open Telegram to view this post
VIEW IN TELEGRAM
❤32👍9🔥2
Lazy loading is a strategy to load images only when required (when the browser detects that the user is going to scroll near it)
Please open Telegram to view this post
VIEW IN TELEGRAM
❤22👍8
Using the clip-path to create a slanted section in CSS!
More developers should start using clip-path, it is very underrated 😁 you can create any shape you want with it!
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
❤28👍7
Please open Telegram to view this post
VIEW IN TELEGRAM
❤21👍2
Please open Telegram to view this post
VIEW IN TELEGRAM
👍11
Not every layout needs to be a rectangle.
CSS clip-path lets you shape UI directly in CSS with real browser support.
Perfect for cards, heroes, and modern layouts.
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
❤18👍5🔥3
align-items and align-content were two of my most confusing properties when I started out on CSS. Here is a visualization for the same!
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
❤19👍2
Build one layout for everyone.
Logical properties in CSS help your site support RTL languages, complex writing systems, and responsive UI with less effort. Time to go global with your styles.
Logical properties in CSS help your site support RTL languages, complex writing systems, and responsive UI with less effort. Time to go global with your styles.
❤10👍7