<?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 卓琪的开发笔记</title>
    <link>https://zhuoqidev.com/tags/css/</link>
    <description>Recent content in CSS on 卓琪的开发笔记</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-CN</language>
    <copyright>© 2026 Liu ZhuoQi</copyright>
    <lastBuildDate>Mon, 04 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://zhuoqidev.com/tags/css/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Embedding CSS Animation Demos in Hugo Articles</title>
      <link>https://zhuoqidev.com/en/posts/css-animation-demo/</link>
      <pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate>
      
      <guid>https://zhuoqidev.com/en/posts/css-animation-demo/</guid>
      <description>&lt;p&gt;Hugo shortcodes make it easy to embed live code demos. Here are three ways:&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;1. Inline CSS Demo (No External Service)&#xA;    &lt;div id=&#34;1-inline-css-demo-no-external-service&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#1-inline-css-demo-no-external-service&#34; aria-label=&#34;锚点&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;A spinning loader animation, right in the article:&lt;/p&gt;&#xA;&lt;div class=&#34;inline-demo&#34; style=&#34;margin: 1.5rem 0;&#34;&gt;&#xA;  &lt;iframe&#xA;    id=&#34;demo-8e7b60567f581c34a5d9e12e05cdeb9d-0&#34;&#xA;    style=&#34;width:100%; height:200px; border:1px solid #dedad4; border-radius:6px; background:#faf8f5;&#34;&#xA;    scrolling=&#34;no&#34;&#xA;    sandbox=&#34;allow-scripts allow-same-origin&#34;&gt;&#xA;  &lt;/iframe&gt;&#xA;  &lt;p style=&#34;font-size:0.8rem; color:#777; text-align:center; margin-top:0.5rem;&#34;&gt;Pure CSS Spinner&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;template id=&#34;demo-8e7b60567f581c34a5d9e12e05cdeb9d-0-src&#34;&gt;&#xA;&lt;style&gt;&#xA;  .loader {&#xA;    width: 48px;&#xA;    height: 48px;&#xA;    border: 4px solid #e8e4de;&#xA;    border-top-color: #c44020;&#xA;    border-radius: 50%;&#xA;    animation: spin 0.8s linear infinite;&#xA;  }&#xA;  @keyframes spin {&#xA;    to { transform: rotate(360deg); }&#xA;  }&#xA;&lt;/style&gt;&#xA;&lt;div class=&#34;loader&#34;&gt;&lt;/div&gt;&#xA;&lt;/template&gt;&#xA;&lt;script&gt;&#xA;(function() {&#xA;  var src = document.getElementById(&#34;demo-8e7b60567f581c34a5d9e12e05cdeb9d-0-src&#34;).innerHTML;&#xA;  var iframe = document.getElementById(&#34;demo-8e7b60567f581c34a5d9e12e05cdeb9d-0&#34;);&#xA;  var doc = iframe.contentDocument || iframe.contentWindow.document;&#xA;  doc.open();&#xA;  doc.write(&#xA;    &#39;&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;meta charset=&#34;utf-8&#34;&gt;&#39; +&#xA;    &#39;&lt;style&gt;*{box-sizing:border-box}body{margin:0;display:flex;align-items:center;&#39; +&#xA;    &#39;justify-content:center;min-height:200px;background:#faf8f5;&#39; +&#xA;    &#39;font-family:system-ui,sans-serif}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&#39; +&#xA;    src +&#xA;    &#39;&lt;/body&gt;&lt;/html&gt;&#39;&#xA;  );&#xA;  doc.close();&#xA;})();&#xA;&lt;/script&gt;&#xA;&lt;p&gt;A gradient text animation:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>在 Hugo 文章里内嵌 CSS 动画 Demo</title>
      <link>https://zhuoqidev.com/posts/css-animation-demo/</link>
      <pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate>
      
      <guid>https://zhuoqidev.com/posts/css-animation-demo/</guid>
      <description>&lt;p&gt;Hugo 用 shortcode 可以很优雅地内嵌代码演示。这里展示三种方式：&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;1. 内联 CSS demo（无需外部服务）&#xA;    &lt;div id=&#34;1-内联-css-demo无需外部服务&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#1-%e5%86%85%e8%81%94-css-demo%e6%97%a0%e9%9c%80%e5%a4%96%e9%83%a8%e6%9c%8d%e5%8a%a1&#34; aria-label=&#34;锚点&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;直接在文章里跑一个旋转加载动画：&lt;/p&gt;&#xA;&lt;div class=&#34;inline-demo&#34; style=&#34;margin: 1.5rem 0;&#34;&gt;&#xA;  &lt;iframe&#xA;    id=&#34;demo-c9e1e4cadf51119cb40d357b2fe4d93d-0&#34;&#xA;    style=&#34;width:100%; height:200px; border:1px solid #dedad4; border-radius:6px; background:#faf8f5;&#34;&#xA;    scrolling=&#34;no&#34;&#xA;    sandbox=&#34;allow-scripts allow-same-origin&#34;&gt;&#xA;  &lt;/iframe&gt;&#xA;  &lt;p style=&#34;font-size:0.8rem; color:#777; text-align:center; margin-top:0.5rem;&#34;&gt;纯 CSS 旋转加载器&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;template id=&#34;demo-c9e1e4cadf51119cb40d357b2fe4d93d-0-src&#34;&gt;&#xA;&lt;style&gt;&#xA;  .loader {&#xA;    width: 48px;&#xA;    height: 48px;&#xA;    border: 4px solid #e8e4de;&#xA;    border-top-color: #c44020;&#xA;    border-radius: 50%;&#xA;    animation: spin 0.8s linear infinite;&#xA;  }&#xA;  @keyframes spin {&#xA;    to { transform: rotate(360deg); }&#xA;  }&#xA;&lt;/style&gt;&#xA;&lt;div class=&#34;loader&#34;&gt;&lt;/div&gt;&#xA;&lt;/template&gt;&#xA;&lt;script&gt;&#xA;(function() {&#xA;  var src = document.getElementById(&#34;demo-c9e1e4cadf51119cb40d357b2fe4d93d-0-src&#34;).innerHTML;&#xA;  var iframe = document.getElementById(&#34;demo-c9e1e4cadf51119cb40d357b2fe4d93d-0&#34;);&#xA;  var doc = iframe.contentDocument || iframe.contentWindow.document;&#xA;  doc.open();&#xA;  doc.write(&#xA;    &#39;&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;meta charset=&#34;utf-8&#34;&gt;&#39; +&#xA;    &#39;&lt;style&gt;*{box-sizing:border-box}body{margin:0;display:flex;align-items:center;&#39; +&#xA;    &#39;justify-content:center;min-height:200px;background:#faf8f5;&#39; +&#xA;    &#39;font-family:system-ui,sans-serif}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&#39; +&#xA;    src +&#xA;    &#39;&lt;/body&gt;&lt;/html&gt;&#39;&#xA;  );&#xA;  doc.close();&#xA;})();&#xA;&lt;/script&gt;&#xA;&lt;p&gt;一个渐变色文字动画：&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
