Mini-project: a profile card
หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
โปรเจค mini ของคุณ
- เวลาที่จะรวมทุกอย่างเข้าด้วยกันและสร้าง บัตรข้อมูลส่วนบุคคล
- นี่คือสิ่งที่คุณกำลังมุ่งหมาย:
English
<style>
.card { width: 280px; margin: 0 auto; padding: 20px; text-align: center;
background-color: #f8fafc; border: 1px solid #cbd5e1; border-radius: 12px; }
h2 { color: teal; margin: 8px 0; }
</style>
<div class="card">
<img src="/static/code/web-basics/cat.svg" alt="My avatar" width="120">
<h2>Sam Lee</h2>
<p>I love drawing and football.</p>
</div>
สิ่งที่เรียนรู้มา
- HTML: หัวข้อ,ย่อหน้า,รายการ,ลิงก์,ภาพ,ตาราง,ฟอร์ม,โครงสร้างหน้าเว็บ
- CSS: สี,ข้อความ,โครงสร้างกล่อง,ระยะห่าง,ขนาด,และแถวด้วย Flexbox
- นั่นคือรากฐานจริงของ every web page. You can build things now. 🎉
ข้อผิดพลาดที่พบบ่อย
- สร้างและตรวจสอบ piece at a time
- รักษา HTML structure และ CSS styling แยกออกจากกัน
สร้างการ์ดของคุณ
- Layout ของการ์ดถูก styled ไว้แล้ว, so you can focus on filling it in
- แต่ละ task เพิ่ม one piece — content, a picture, แล้วตามด้วยสี. Press ▶ บ่อยๆ!
ความยาก 4/5 · 280 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Start your card. Inside the .card, add an <h2> with a name and a <p> with one line about you.
ความยาก 4/5 · 280 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Add a picture above the name. Add an <img src="/static/code/web-basics/cat.svg"> with alt text, just inside the card.
ความยาก 4/5 · 280 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Finish it with a splash of colour. Give the h2 a colour you like, e.g. h2 { color: teal; }.