Menu
CoddyTech

ポータルの基本構造

CoddyのTailwind CSSジャーニー「レスポンシブUIパターン」セクションの一部。レッスン 51/55。

用意された完成済みページを使って、イベントポータルのシェルを構築しましょう。シェルは少なくともビューポートの高さがあるグリッドにし、幅は最大960pxに制限して中央に配置します。用意されている64pxのヘッダーと48pxのフッターを維持します。メイン領域は768px未満では1列にし、768px以上では160pxのナビゲーションレールと、残りのスペースに合わせて縮小するコンテンツトラックを配置し、両方向に24pxのギャップを設けます。3つのナビゲーションリンクは、12pxのギャップを設けた折り返し可能なフレックスリストにします。用意されている後続ステージのすべての領域、コントロール、ハンドラーをそのまま維持してください。

challenge icon

チャレンジ

上級者

用意された完成済みのページを使って、イベントポータルのシェルを構築します。シェルは少なくともビューポートの高さがあるグリッドにし、幅は960pxを上限として中央に配置し、用意された64pxのヘッダーと48pxのフッターを維持します。メイン領域は768px未満では1列、768px以上では160pxのナビゲーションレールと、縮小可能な残りのスペースを使うコンテンツトラックを配置し、縦横両方に24pxの間隔を設けます。3つのナビゲーションリンクは、12pxの間隔を設けた折り返し可能なフレックスリストにします。後続段階用に用意されたすべての領域、コントロール、ハンドラーを維持します。

用意されたコンテンツ、セマンティック要素、IDを維持します。指定されたユーティリティクラスを編集します。編集後に「プレビューを実行」を押し、その後「確認」/「コードを実行」を押して結果を採点します。用意されたJavaScriptは読み取り専用です。

自分で試してみよう

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Interface workshop</title><link rel="stylesheet" href="./styles.css"></head><body>
<a id="skip" href="#main" class="sr-only">Skip to event content</a>
<div id="shell" class="w-full max-w-[960px] mx-auto ">
<header id="header" class="h-16 flex items-center px-4 bg-slate-900 text-white"><h1 class="text-xl font-bold">Open Studio Weekend</h1></header>
<main id="main" tabindex="-1" class="">
<nav id="nav" aria-label="Event sections" class="p-4"><ul id="navList" class=""><li><a href="#sessions">Sessions</a></li><li><a href="#booking">Booking</a></li><li><a href="#schedule">Schedule</a></li></ul></nav>
<div id="content" class="min-w-0 space-y-6 ">
<section id="sessions" aria-labelledby="sessionsTitle"><h2 id="sessionsTitle" class="text-xl font-bold mb-3">Choose a studio</h2><div id="cards" class="grid grid-cols-1">
<article id="cardA" class="h-56 p-4 rounded-xl bg-slate-100 "><h3 class="h-6 font-bold">Printmaking</h3><p class="h-12">Make a small edition with local artists.</p><a id="cardAAction" href="#booking" class="h-10 ">Choose printmaking</a></article>
<article id="cardB" class="h-56 p-4 rounded-xl bg-slate-100 "><h3 class="h-6 font-bold">Clay studio</h3><p class="h-12">Explore hand-built forms and texture.</p><a id="cardBAction" href="#booking" class="h-10 ">Choose clay</a></article>
</div></section>
<section id="booking" aria-labelledby="bookingTitle"><h2 id="bookingTitle" class="text-xl font-bold mb-3">Plan your visit</h2>
<form id="form" class="grid grid-cols-1"><div><label for="name" class="block">Name</label><input id="name" class="w-full h-10 border p-2"></div><div><label for="email" class="block">Email</label><input id="email" type="email" required class="w-full h-10 border p-2 outline-solid outline-0"></div>
<fieldset id="choices" class=""><legend>Guide format</legend><label id="digitalCard" class="block p-3 "><input id="digital" type="radio" name="guide"> Digital guide</label><label id="printedCard" class="block p-3 "><input id="printed" type="radio" name="guide"> Printed guide</label></fieldset></form>
</section>
<section id="schedule" aria-labelledby="scheduleTitle"><h2 id="scheduleTitle" class="text-xl font-bold mb-3">Weekend schedule</h2><div id="tableWrap" class="w-full h-40 overflow-hidden"><table id="table" class="w-full border-separate border-spacing-0 "><caption>Studio start times</caption><colgroup><col class="w-40"><col></colgroup><thead><tr><th scope="col" class="">Time</th><th scope="col" class="">Session</th></tr></thead><tbody><tr><th scope="row">09:00</th><td>Welcome</td></tr><tr><th scope="row">09:30</th><td>Printmaking</td></tr><tr><th scope="row">10:00</th><td>Clay studio</td></tr><tr><th scope="row">10:30</th><td>Drawing</td></tr><tr><th scope="row">11:00</th><td>Color workshop</td></tr><tr><th scope="row">11:30</th><td>Studio tour</td></tr><tr><th scope="row">12:00</th><td>Lunch</td></tr><tr><th scope="row">13:00</th><td>Open practice</td></tr></tbody></table></div></section>
<section aria-label="Reservation"><button id="availability" class="my-3 p-2 border">Toggle reservation availability</button><div id="reserveArea" class="relative w-64 h-20"><button id="reserve" disabled class="absolute inset-0 outline-solid bg-blue-100 outline-0">Reserve a place</button><div id="reserveFrame" aria-hidden="true" class="absolute inset-0 border-2 border-blue-700 "></div></div><p>Reservations made: <output id="count">0</output></p></section>
</div></main><footer id="footer" class="h-12 flex items-center px-4 bg-slate-100">Access information is available at the welcome desk.</footer></div>
<script src="./controls.js"></script>
</body></html>
quiz icon腕試し

このレッスンには短いクイズがあります。レッスンを始めて解答し、進捗を記録しましょう。

レスポンシブUIパターンのすべてのレッスン