AIGPAIGP

コンテナクエリでレスポンシブに変化!カード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.

代码预览

エディタを読み込み中…

AIとの対話に追加する一言

プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします

このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。

初心者なので、各行にコメントを追加して、何をしているか説明してください。

このコードをWordPressのテーマに組み込む方法も教えてください。

動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。

このインタラクティブプレイグラウンドでは、CSS Container Queries の挙動を体験できます。従来のビューポート基準ではなく、親コンテナの幅に応じて要素のレイアウトが変化します。スライダーでコンテナ幅を調整すると、300px・500px のブレークポイントでカードが縦積み→横並び→大きなサムネイル付きに変化します。

这个提示对您有帮助吗?

评论

评论将在审核后显示

この記事が役に立ったら投げ銭で応援

Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済

開発者が選ぶ最強ツール集

運営者が毎日使っているツール・ガジェット 6選

見る
首页ヘルプ