Interactive Text-Balance Playground: CSS text-wrap: balance & pretty
Prompt
Create an interactive playground to explore CSS text-wrap: balance and text-wrap: pretty. Include a heading with long text, a slider to change container width, a toggle between balance/pretty/auto, and a live preview showing how the line wrapping changes.
CODE PREVIEW
AIとの対話に追加する一言
プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします
このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。
初心者なので、各行にコメントを追加して、何をしているか説明してください。
このコードをWordPressのテーマに組み込む方法も教えてください。
動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。
このインタラクティブプレイグラウンドでは、text-wrap: balance、text-wrap: pretty、text-wrap: auto の違いをリアルタイムで体験できます。スライダーでコンテナ幅を調整すると、見出しの改行位置が変化します。balance は各行をなるべく均等にし、視覚的な調和を高めます。pretty は最終行を最適化してオーファンを防ぎます。auto はブラウザのデフォルト改行です。幅を変えながらトグルして、タイポグラフィに最適な設定を見つけてください。
Prompt Overview
This interactive playground lets you experience the difference between text-wrap: balance, text-wrap: pretty, and text-wrap: auto in real time. Adjust the container width with the slider to see how the heading's line breaks adapt. The balance value makes each line nearly equal length, improving visual harmony. Pretty optimizes the last line to avoid orphans. Auto lets the browser decide default wrapping. Resize and toggle to find the perfect setting for your typography.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選