<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Layout on Commentary of Takao</title><link>https://takao.blog/en/tags/layout/</link><description>Recent content in Layout on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Commentary of Takao</copyright><lastBuildDate>Sat, 13 Jun 2026 23:11:50 +0900</lastBuildDate><atom:link href="https://takao.blog/en/tags/layout/index.xml" rel="self" type="application/rss+xml"/><item><title>Preventing Cumulative Layout Shift with CSS aspect-ratio</title><link>https://takao.blog/en/web/css-aspect-ratio-cumulative-layout-shift/</link><pubDate>Wed, 10 Dec 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-aspect-ratio-cumulative-layout-shift/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Preventing Cumulative Layout Shift with CSS aspect-ratio" /&gt;&lt;h2 id="understanding-cumulative-layout-shift"&gt;Understanding Cumulative Layout Shift
&lt;/h2&gt;&lt;p&gt;Cumulative Layout Shift (CLS) is one of Google&amp;rsquo;s &lt;strong&gt;Core Web Vitals&lt;/strong&gt; metrics that measures visual stability. It quantifies how often users experience unexpected layout shifts. A high CLS score harms user experience and SEO rankings. The primary cause? Media elements (images, videos, iframes) loading without reserved space.&lt;/p&gt;
&lt;h2 id="how-css-aspect-ratio-works"&gt;How CSS aspect-ratio Works
&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;aspect-ratio&lt;/code&gt; CSS property lets you declare the ratio of width to height for any element. The browser reserves space accordingly, preventing the layout from jumping when content loads.&lt;/p&gt;</description></item><item><title>Perfect Alignment with CSS Grid Subgrid</title><link>https://takao.blog/en/web/css-subgrid-grid-nesting/</link><pubDate>Sat, 10 May 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-subgrid-grid-nesting/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Perfect Alignment with CSS Grid Subgrid" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Aligning nested components across columns in card layouts is a common layout challenge in responsive web design.&lt;/p&gt;
&lt;p&gt;While CSS Grid and Flexbox make it easy to equalise the height of sibling card containers, aligning the internal elements (such as headers, body copy, and CTA buttons) remains difficult. If one card has a multi-line title and another has a single line, the following elements will misalign, resulting in an inconsistent UI.&lt;/p&gt;</description></item><item><title>Introduction to CSS Anchor Positioning and Examples</title><link>https://takao.blog/en/web/css-anchor-positioning-guide/</link><pubDate>Mon, 10 Feb 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-anchor-positioning-guide/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Introduction to CSS Anchor Positioning and Examples" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;In web development, positioning floating elements—such as tooltips, popovers, dropdown menus, and hover cards—relative to a specific reference element (the anchor) has historically been a complex challenge.&lt;/p&gt;
&lt;p&gt;To make floating elements follow anchor points on window resizing or page scrolling, developers traditionally relied on continuous JavaScript coordinate calculations (using &lt;code&gt;getBoundingClientRect()&lt;/code&gt;) to dynamically alter inline styles. Libraries like Popper.js or Floating UI became industry standards for this reason. However, executing script loops on the main thread during scroll events frequently caused rendering lag and jank, especially on mobile devices.&lt;/p&gt;</description></item><item><title>CSS Grid Advanced Patterns: Complex Layouts Made Simple</title><link>https://takao.blog/en/web/css-grid-advanced/</link><pubDate>Fri, 15 Dec 2023 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-grid-advanced/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS Grid Advanced Patterns: Complex Layouts Made Simple" /&gt;&lt;p&gt;CSS Grid has transformed web layout design, but many developers only scratch the surface. Beyond the basic &lt;code&gt;grid-template-columns: 1fr 1fr 1fr&lt;/code&gt; lies a powerful set of features that handle complex, responsive layouts with minimal code. This article explores advanced Grid patterns that every professional front-end developer should know.&lt;/p&gt;
&lt;h2 id="named-grid-areas-for-semantic-layouts"&gt;Named Grid Areas for Semantic Layouts
&lt;/h2&gt;&lt;p&gt;Line-based placement works, but it becomes unreadable as layouts grow complex. Named grid areas let you define layouts that read like a wireframe directly in CSS.&lt;/p&gt;</description></item></channel></rss>