<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>CSS on cloudmato.com</title><link>https://cloudmato.com/tags/css/</link><description>Recent content in CSS on cloudmato.com</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>cloudmato.com</managingEditor><webMaster>cloudmato.com</webMaster><lastBuildDate>Sat, 13 Jun 2026 22:29:27 +0530</lastBuildDate><atom:link href="https://cloudmato.com/tags/css/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Create Animated SVG (And Is It Better Than GIF?)</title><link>https://cloudmato.com/posts/how-to-create-animated-svg-vs-gif/</link><pubDate>Sat, 13 Jun 2026 22:29:27 +0530</pubDate><author>cloudmato.com</author><guid>https://cloudmato.com/posts/how-to-create-animated-svg-vs-gif/</guid><description>&lt;p&gt;Remember when GIFs were basically the &lt;em&gt;only&lt;/em&gt; way to show something moving on a webpage without dragging in a full video player? Spinning loaders, little waving mascots, &amp;ldquo;loading&amp;hellip;&amp;rdquo; icons — all GIFs, all looking slightly blurry and oddly heavy for something so small. Turns out there&amp;rsquo;s been a much better option sitting right under our noses for years: the animated SVG. Let&amp;rsquo;s get into how you actually build one, and whether it really deserves to replace GIF.&lt;/p&gt;</description></item><item><title>Every Way to Set Font Size in a UI (and Which Wins)</title><link>https://cloudmato.com/posts/every-way-to-set-font-size-in-ui/</link><pubDate>Sat, 13 Jun 2026 08:16:18 +0530</pubDate><author>cloudmato.com</author><guid>https://cloudmato.com/posts/every-way-to-set-font-size-in-ui/</guid><description>&lt;p&gt;Ever opened a project&amp;rsquo;s CSS and found font sizes set in &lt;code&gt;px&lt;/code&gt;, &lt;code&gt;em&lt;/code&gt;, &lt;code&gt;rem&lt;/code&gt;, &lt;code&gt;%&lt;/code&gt;, and &lt;code&gt;vw&lt;/code&gt; — all in the same file, sometimes on the same element? Yeah, me too. Font size feels like the most boring property in CSS until you realize there are at least &lt;strong&gt;eight different ways&lt;/strong&gt; to express it, and picking the wrong one quietly breaks accessibility for a chunk of your users without throwing a single error.&lt;/p&gt;</description></item><item><title>Every Way to Center a Div in CSS, Ranked (2026)</title><link>https://cloudmato.com/posts/center-a-div-css-2026/</link><pubDate>Wed, 03 Jun 2026 17:28:24 +0530</pubDate><author>cloudmato.com</author><guid>https://cloudmato.com/posts/center-a-div-css-2026/</guid><description>&lt;p&gt;Nobody ever forgets their first fight with CSS centering. You Google it, paste a Stack Overflow snippet, and move on — never stopping to ask if that was the &lt;em&gt;right&lt;/em&gt; way or just &lt;em&gt;a&lt;/em&gt; way. In 2026, there are at least seven distinct ways to center a div, and some of them should have been buried years ago.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s all of them, ranked worst to best.&lt;/p&gt;
&lt;h2 class="header-anchor-wrapper"&gt;The Full Comparison
&lt;a href="#the-full-comparison" class="header-anchor-link"&gt;
&lt;svg
xmlns="http://www.w3.org/2000/svg"
width="1rem" height="1rem" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"&gt;
&lt;line x1="4" y1="9" x2="20" y2="9"&gt;&lt;/line&gt;&lt;line x1="4" y1="15" x2="20" y2="15"&gt;&lt;/line&gt;&lt;line x1="10" y1="3" x2="8" y2="21"&gt;&lt;/line&gt;&lt;line x1="16" y1="3" x2="14" y2="21"&gt;&lt;/line&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Horizontal&lt;/th&gt;
&lt;th&gt;Vertical&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;display: table-cell&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Never&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Negative margins&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Never&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;abs&lt;/code&gt; + &lt;code&gt;translate(-50%, -50%)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Avoid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;inset: 0&lt;/code&gt; + &lt;code&gt;margin: auto&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Sometimes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;margin: auto&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Horizontal only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flexbox&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Good default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSS Grid&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Best default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSS Anchor Positioning&lt;/td&gt;
&lt;td&gt;Relative&lt;/td&gt;
&lt;td&gt;Relative&lt;/td&gt;
&lt;td&gt;Specific use&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;h2 class="header-anchor-wrapper"&gt;1. &lt;code&gt;display: table-cell&lt;/code&gt; — Please Stop
&lt;a href="#1-display-table-cell--please-stop" class="header-anchor-link"&gt;
&lt;svg
xmlns="http://www.w3.org/2000/svg"
width="1rem" height="1rem" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"&gt;
&lt;line x1="4" y1="9" x2="20" y2="9"&gt;&lt;/line&gt;&lt;line x1="4" y1="15" x2="20" y2="15"&gt;&lt;/line&gt;&lt;line x1="10" y1="3" x2="8" y2="21"&gt;&lt;/line&gt;&lt;line x1="16" y1="3" x2="14" y2="21"&gt;&lt;/line&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;This is what people did before Flexbox existed. You wrap your element in a fake table, trick the browser into treating it like a &lt;code&gt;&amp;lt;td&amp;gt;&lt;/code&gt;, and abuse &lt;code&gt;vertical-align: middle&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>CSS Layout History: Tables to Grid — What to Use in 2026</title><link>https://cloudmato.com/posts/css-layout-history-flexbox-grid-2026/</link><pubDate>Tue, 02 Jun 2026 22:15:04 +0530</pubDate><author>cloudmato.com</author><guid>https://cloudmato.com/posts/css-layout-history-flexbox-grid-2026/</guid><description>&lt;p&gt;Every few years the &amp;ldquo;right&amp;rdquo; way to do layout in CSS changes completely. If you started writing CSS before 2015, you probably have a small trauma response every time someone mentions &lt;code&gt;clearfix&lt;/code&gt;. Let me walk through how we got here — and what you should actually reach for in 2026.&lt;/p&gt;
&lt;h2 class="header-anchor-wrapper"&gt;The Table Era (1990s – mid 2000s)
&lt;a href="#the-table-era-1990s--mid-2000s" class="header-anchor-link"&gt;
&lt;svg
xmlns="http://www.w3.org/2000/svg"
width="1rem" height="1rem" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"&gt;
&lt;line x1="4" y1="9" x2="20" y2="9"&gt;&lt;/line&gt;&lt;line x1="4" y1="15" x2="20" y2="15"&gt;&lt;/line&gt;&lt;line x1="10" y1="3" x2="8" y2="21"&gt;&lt;/line&gt;&lt;line x1="16" y1="3" x2="14" y2="21"&gt;&lt;/line&gt;
&lt;/svg&gt;
&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;HTML tables were never designed for layout. They existed to display tabular data. Then web designers discovered that &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;tr&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;td&amp;gt;&lt;/code&gt; gave you something CSS couldn&amp;rsquo;t yet deliver: predictable column control [1].&lt;/p&gt;</description></item></channel></rss>