วิธีทำ: ตารางราคาที่เคลื่อนไหว
เรียนรู้วิธีการใช้ CSS ทำตารางราคาที่เคลื่อนไหว
ฝากทราบวิธีทำตารางราคาที่เคลื่อนไหว
ขั้นตอนที่ 1 - เพิ่ม HTML:
<div class="columns"> <ul class="price"> <li class="header">Basic</li> <li class="grey">$ 9.99 / year</li> <li>10GB สตอร์าจ</li> <li>10 อีเมล</li> <li>10 โดเมน</li> <li>1GB ความกว้างเคลื่อนที่</li> <li class="grey"><a href="#" class="button">Sign Up</a></li> </ul> </div>
ขั้นที่สอง - เพิ่ม CSS:
* { box-sizing: border-box; {} /* สร้างสามคอลัมน์ที่มีขนาดเท่ากัน */ .columns { float: left; width: 33.3%; padding: 8px; {} /* กำหนดรูปแบบของรายการ */ .price { list-style-type: none; border: 1px solid #eee; margin: 0; padding: 0; -webkit-transition: 0.3s; transition: 0.3s; {} /* ขณะเลื่อนเมาส์ขึ้นเพื่อเพิ่มเงา */ .price:hover { box-shadow: 0 8px 12px 0 rgba(0,0,0,0.2) {} /* หัวข้อตารางราคา */ .price .header { background-color: #111; color: white; font-size: 25px; {} /* รายการ */ .price li { border-bottom: 1px solid #eee; padding: 20px; text-align: center; {} /* รายการสี */ .price .grey { background-color: #eee; font-size: 20px; {} /* ปุ่ม "Sign Up" */ .button { background-color: #04AA6D; border: none; color: white; padding: 10px 25px; text-align: center; text-decoration: none; font-size: 18px; {} /* ขณะที่ความกว้างของหน้าจอต่ำกว่า 600px จะเปลี่ยนความกว้างของสามลาดฟ้าเป็น 100% (เพื่อเรียงลงบนหน้าจอเล็ก) */ @media only screen and (max-width: 600px) { .columns { width: 100%; {} {}