One shortcut clears both sides — and drops a box below every float! Here is the trick! ⚡ In this Emmet shortcut you will learn cl:b, the shortcut for the CSS clear: both property — type it, press Tab, and your stylesheet gets clear: both; with just four keys. No long code — one shortcut does it all!
Type cl:b in your code editor, press TAB, and Emmet instantly expands it into the clear both property:
.box {
clear: both;
}
C and L mean clear — colon picks a value — and b means both! Clear both means: drop below floats on the left AND the right! It clears both sides at once — nothing stays beside the box! Without it, a box can get squeezed between two floated photos and crowd your layout; with clear both, the box drops neatly below both floats. Both floats cleared — your layout stays clean. Remember: clear both is the strongest clear — it waits until BOTH sides are free!
Works in VS Code, Sublime Text, WebStorm and most modern editors — Emmet is built in.
👇 Comment below: where would YOU use clear both — under a gallery of floated photos, or to end a floated layout? What should we build in Shortcut #135 — d, display block?
Follow My Devtools for one new Emmet shortcut every hour!
#Emmet #CSS #VSCode #WebDevelopment #CodingShorts
source

⚡ Shortcut #134: cl:b — type cl:b, press Tab, and Emmet gives you clear: both;! The box drops below both floats — both sides cleared! Next up: d — display block! 👇