{"id":9235,"date":"2026-04-10T10:45:34","date_gmt":"2026-04-10T15:45:34","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=9235"},"modified":"2026-04-10T10:45:36","modified_gmt":"2026-04-10T15:45:36","slug":"how-i-lost-madcss","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/how-i-lost-madcss\/","title":{"rendered":"How I Lost MadCSS"},"content":{"rendered":"\n<p>I was very lucky to get to compete in Syntax&#8217;s <a href=\"https:\/\/madcss.com\/\">MadCSS<\/a> Battle recently. I got rightfully ousted <a href=\"https:\/\/www.youtube.com\/watch?v=YZZbc57DyQI&amp;list=PLLnpHn493BHE6Wh1h9TViNozVRjjCOj3k&amp;index=4\">in the 2nd round<\/a> by Scott himself! See the outcome of the battle in the image below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"421\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/Screenshot-2026-04-06-at-7.33.17-AM.png?resize=1024%2C421&#038;ssl=1\" alt=\"Comparison of two competitors, Scott Tolinski and Chris Coyier, showing their scores and feedback on a project. Scott is marked as the winner with a 92.42% match, while Chris has an 81.97% match. Feedback from various reviewers is displayed under each competitor.\" class=\"wp-image-9236\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/Screenshot-2026-04-06-at-7.33.17-AM-scaled.png?resize=1024%2C421&amp;ssl=1 1024w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/Screenshot-2026-04-06-at-7.33.17-AM-scaled.png?resize=300%2C123&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/Screenshot-2026-04-06-at-7.33.17-AM-scaled.png?resize=768%2C316&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/Screenshot-2026-04-06-at-7.33.17-AM-scaled.png?resize=1536%2C631&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/Screenshot-2026-04-06-at-7.33.17-AM-scaled.png?resize=2048%2C842&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>I feel like I had the correct idea of how to approach it all just fine. But can you see how I lost? A GRID BLOWOUT! WTF! I feel like I&#8217;ve been <a href=\"https:\/\/css-tricks.com\/preventing-a-grid-blowout\/\">helping people AVOID grid blowouts <\/a>for a long time.<\/p>\n\n\n\n<p>I recently logged back into their SynHax<sup data-fn=\"96d2e99b-8735-4d67-bb8a-45fcd7406942\" class=\"fn\"><a href=\"#96d2e99b-8735-4d67-bb8a-45fcd7406942\" id=\"96d2e99b-8735-4d67-bb8a-45fcd7406942-link\">1<\/a><\/sup> website that powers the battles, so I could figure out just what the heck went wrong. Best to learn from our mistakes, right?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">I Started Forcing Widths<\/h2>\n\n\n\n<p>Once the grid blew out on me (started hanging off the right edge), a bad instinct kicked in, where I started setting <code>width<\/code> values that I didn&#8217;t need to set.<\/p>\n\n\n\n<p>It started with:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">body<\/span> {\n  <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">100vw<\/span>;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This was wholly unnecessary as the body is already the width of the viewport. \ud83e\udd26. Fortunately, the margins were set to zero; otherwise, I would have introduced scrollbars, which would have made the problem even worse.<\/p>\n\n\n\n<p>As that didn&#8217;t fix it, I forced the grid itself, the <code>#container<\/code> to also be as wide as the viewport.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-id\">#container<\/span> {\n  <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">100<\/span>dvw;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This was <em>extra<\/em> counter-productive as there was <code>padding<\/code> on the <code>body<\/code>, meaning instead of <em>squeezing,<\/em> which is what I was hoping to do on the grid, I was forcing it to be as wide as the viewport but nudged over because of the body padding. So even if I figured out the underlying issue, I&#8217;d be forcing the grid blowout myself.<\/p>\n\n\n\n<p>The correct thing to do was just leave everything pretty normal and old school:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">html<\/span>, <span class=\"hljs-selector-tag\">body<\/span> {\n  <span class=\"hljs-attribute\">margin<\/span>: <span class=\"hljs-number\">0<\/span>;\n  <span class=\"hljs-attribute\">padding<\/span>: <span class=\"hljs-number\">0<\/span>;\n  <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">100%<\/span>;\n  <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">100%<\/span>;\n}\n\n<span class=\"hljs-selector-id\">#container<\/span> {\n  <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">100%<\/span>;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">I Even Bungled The Grid Setup<\/h2>\n\n\n\n<p>It&#8217;s three columns and two rows. This is correct:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-id\">#container<\/span> {\n  <span class=\"hljs-attribute\">grid-template-columns<\/span>: <span class=\"hljs-built_in\">repeat<\/span>(<span class=\"hljs-number\">3<\/span>, <span class=\"hljs-number\">1<\/span>fr);\n  <span class=\"hljs-attribute\">grid-template-rows<\/span>: <span class=\"hljs-built_in\">repeat<\/span>(<span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">1<\/span>fr);\n\n  <span class=\"hljs-comment\">\/* or go simple *\/<\/span>\n  <span class=\"hljs-attribute\">grid-template-columns<\/span>: <span class=\"hljs-number\">1<\/span>fr <span class=\"hljs-number\">1<\/span>fr <span class=\"hljs-number\">1<\/span>fr;\n  <span class=\"hljs-attribute\">grid-template-rows<\/span>: <span class=\"hljs-number\">1<\/span>fr <span class=\"hljs-number\">1<\/span>fr;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>I wrote&#8230;<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">grid-template-rows<\/span>: <span class=\"hljs-selector-tag\">repeat<\/span>(1, 50%);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Which makes like zero sense, but essentially works fine because it makes one row 50%, and the other takes up the remaining space. Not quite correct (because of the gap) but pretty close. I probably <em>meant<\/em> to write:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">grid-template-rows<\/span>: <span class=\"hljs-selector-tag\">repeat<\/span>(2, 50%);\n<span class=\"hljs-comment\">\/* or *\/<\/span>\n<span class=\"hljs-selector-tag\">grid-template-rows<\/span>: 50% 50%;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>That would have caused <em>another<\/em> grid blowout because then the height would have been 100% plus the <code>gap<\/code>. Jeez, self, get it together. I think I was trying to use <code>50%<\/code> in an attempt the vertical blowout that was also happening.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Wrong Overflow<\/h2>\n\n\n\n<p>So even if I didn&#8217;t bungle the grid setup and width situation, I&#8217;d have a blowout. That&#8217;s because for whatever god-forsaken reason, I went for <code>overflow: clip;<\/code> on each of the elements in the grid cells. I tend to think of that like <code>overflow: hidden;<\/code> but stronger, but I obviously I don&#8217;t understand it well enough, because as you can see:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"800\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/CleanShot-2026-04-08-at-15.32.44.gif?resize=637%2C800&#038;ssl=1\" alt=\"\" class=\"wp-image-9274\" style=\"width:354px;height:auto\"\/><figcaption class=\"wp-element-caption\"><code>hidden<\/code> works, <code>clip<\/code> does not.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Text Size Overflow<\/h2>\n\n\n\n<p>Circling back, though, what was the root cause of the horizontal overflow? It <em>looks<\/em> like everything is plenty squishy enough to fit into three columns without needing to break out of a <code>1fr<\/code> column. But again, I got in my own way.<\/p>\n\n\n\n<p>The trouble we can blame on one Mrs. <strong>Brenda Montgomery<\/strong>.<\/p>\n\n\n\n<p>Well, and the fact that I didn&#8217;t allow enough horizontal room for that unbreakable last name. <\/p>\n\n\n\n<p>Yet again, for an unknown god-forsaken reason, I applied <em>extra<\/em> padding to the <em>right<\/em> side of the testimonial container.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1014\" height=\"562\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/CleanShot-2026-04-08-at-16.12.36%402x.png?resize=1014%2C562&#038;ssl=1\" alt=\"\" class=\"wp-image-9275\" style=\"aspect-ratio:1.804329585500923;width:596px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/CleanShot-2026-04-08-at-16.12.36%402x.png?w=1014&amp;ssl=1 1014w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/CleanShot-2026-04-08-at-16.12.36%402x.png?resize=300%2C166&amp;ssl=1 300w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/CleanShot-2026-04-08-at-16.12.36%402x.png?resize=768%2C426&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>That padding isn&#8217;t squishy. Brenda&#8217;s avatar I had set at 50px wide, and that&#8217;s not squishy either (and apparently <code>aspect-ratio: 1<\/code> isn&#8217;t strong enough to make it a circle \ud83e\udd37\u200d\u2640\ufe0f). The <code>gap<\/code> in that header isn&#8217;t squishy either. And neither is &#8220;Montgomery&#8221;. Literally nothing was willing to budge, so: blowout.<\/p>\n\n\n\n<p><em>So many<\/em> things could have fixed this.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A normal <code>15px<\/code> of padding on the right, instead of <code>30px<\/code>, would have fixed it.<\/li>\n\n\n\n<li>Putting <code>flex-wrap: wrap<\/code> on the header would have fixed it. (Well, in real life, it would be fine, but it wouldn&#8217;t have matched the example.)<\/li>\n\n\n\n<li>Heck, even <code>14px<\/code> instead of <code>15px<\/code> <code>font-size<\/code> would have fixed it!<\/li>\n<\/ol>\n\n\n\n\t\t<figure class=\"wp-block-jetpack-videopress jetpack-videopress-player wp-block-jetpack-videopress--has-max-width\" style=\"max-width: 313.992px;\" >\n\t\t\t<div class=\"jetpack-videopress-player__wrapper\"> <iframe title=\"VideoPress Video Player\" aria-label='VideoPress Video Player' width='386' height='750' src='https:\/\/videopress.com\/embed\/MvVrpb30?cover=1&amp;autoPlay=0&amp;controls=1&amp;loop=0&amp;muted=0&amp;persistVolume=1&amp;playsinline=0&amp;preloadContent=metadata&amp;useAverageColor=1&amp;hd=0' frameborder='0' allowfullscreen data-resize-to-parent=\"true\" allow='clipboard-write'><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1770107250'><\/script><\/div>\n\t\t\t\n\t\t\t\n\t\t<\/figure>\n\t\t\n\n\n<h2 class=\"wp-block-heading\">The End<\/h2>\n\n\n\n<p>Obviously, this whole thing was just for fun and in no way affects my sense of self-worth. <\/p>\n\n\n<div class=\"wp-block-image wp-duotone-grayscale\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/IMG_8339.jpeg?resize=768%2C1024&#038;ssl=1\" alt=\"\" class=\"wp-image-9278\" style=\"width:162px;height:auto\" srcset=\"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/IMG_8339-scaled.jpeg?resize=768%2C1024&amp;ssl=1 768w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/IMG_8339-scaled.jpeg?resize=225%2C300&amp;ssl=1 225w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/IMG_8339-scaled.jpeg?resize=1152%2C1536&amp;ssl=1 1152w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/IMG_8339-scaled.jpeg?resize=1536%2C2048&amp;ssl=1 1536w, https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/IMG_8339-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><figcaption class=\"wp-element-caption\">participation medal<\/figcaption><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<ol class=\"wp-block-footnotes\"><li id=\"96d2e99b-8735-4d67-bb8a-45fcd7406942\">It&#8217;s honestly a super cool system. After being invited to join a battle, you are prompted to connect your local file system to a folder where the HTML and CSS files live. That means you can use any local editor you&#8217;d like! As you save the files, they&#8217;re synced to the website, where a preview is built and turned into an image that visually diffs against the target we&#8217;re coding against. <a href=\"#96d2e99b-8735-4d67-bb8a-45fcd7406942-link\" aria-label=\"Jump to footnote reference 1\">\u21a9\ufe0e<\/a><\/li><\/ol>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s fine. I&#8217;m fine. I just like learning ok. <\/p>\n","protected":false},"author":1,"featured_media":9279,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"[{\"content\":\"It's honestly a super cool system. After being invited to join a battle, you are prompted to connect your local file system to a folder where the HTML and CSS files live. That means you can use any local editor you'd like! As you save the files, they're synced to the website, where a preview is built and turned into an image that visually diffs against the target we're coding against.\",\"id\":\"96d2e99b-8735-4d67-bb8a-45fcd7406942\"}]"},"categories":[1],"tags":[7,24,123,202],"class_list":["post-9235","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-post","tag-css","tag-design","tag-grid","tag-overflow"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2026\/04\/loser.jpg?fit=2100%2C1300&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/9235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=9235"}],"version-history":[{"count":8,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/9235\/revisions"}],"predecessor-version":[{"id":9291,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/9235\/revisions\/9291"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/9279"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=9235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=9235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=9235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}