コンテナクエリでレスポンシブに変化!カードUI実験場
代码预览
エディタを読み込み中…
P
提示词
Create an interactive playground demonstrating CSS Container Queries. The page should have a container with resizable width (via slider or dragged handle), and cards inside that change layout based on the container's width (not the viewport). Include at least two breakpoints (e.g., card width < 300px: stacked vertical layout; >= 300px: horizontal row with image left; >= 500px: horizontal with larger thumbnail and text). Use container-type: inline-size, container-name, and @container rules. Add a small preview panel showing current container width. Use a clean, modern design with subtle colors. No JS framework, pure HTML/CSS/JS.
このインタラクティブプレイグラウンドでは、CSS Container Queries の挙動を体験できます。従来のビューポート基準ではなく、親コンテナの幅に応じて要素のレイアウトが変化します。スライダーでコンテナ幅を調整すると、300px・500px のブレークポイントでカードが縦積み→横並び→大きなサムネイル付きに変化します。
这个提示对您有帮助吗?
评论
评论将在审核后显示
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選