如何创建:响应式定价表
学习如何使用 CSS 创建响应式定价表。
如何创建响应式定价表
第一步 - 添加 HTML:
<div class="columns"> <ul class="price"> <li class="header">Basic</li> <li class="grey">$ 9.99 / year</li>
学习如何使用 CSS 创建响应式定价表。
<div class="columns"> <ul class="price"> <li class="header">Basic</li> <li class="grey">$ 9.99 / year</li>
* { 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%; } }