DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> CSS入門知識 >> DIV十CSS布局 >> 布局實例 >> 純CSS3制作漂亮帶動畫效果的主機價格表
純CSS3制作漂亮帶動畫效果的主機價格表
編輯:布局實例     

         網頁上發布產品時,一般都有幾套價格方案,通常我們將幾套方案放在一起,用戶可以相互比較決定購買哪個套餐。最常見的是主機商發布產品價格信息頁,本文結合實例給大家分享以純CSS+HTML實現的價格表。

HTML

我們以某公司推廣VPS產品為例,將HTML結構布局好。其實我們所說的價格表並不是表格,全是ul,li元素組成,通過CSS來美化,展現在我們面前的頁面效果看似表格而已。
 

  代碼如下:
<div id="pricePlans">
<ul id="plans">
<li class="plan">
<ul class="planContainer">
<li class="title"><h2>入門型VPS</h2></li>
<li class="price"><p>¥149/<span>月</span></p></li>
<li>
<ul class="options">
<li>小型企業、個人首選</li>
<li>雙核至強處理器</li>
<li>1G DDR3 ECC >span>高速糾錯內存</span></li>
<li>10G + 20G >span>高速企業級硬盤</span></li>
<li>1M >span>專線帶寬</span></li>
<li>1個 >span>獨立公網IP</span></li>
</ul>
</li>
<li class="button"><a href="#">點擊購買</a></li>
</ul>
</li>
....多個重復的li
</ul>
</div>



CSS

我們運用CSS將幾個li排列成一行,使用CSS3實現陰影、圓角以及鼠標滑上動畫效果,以下是抄錄部分css代碼。大家可以下載源碼包查看完整的代碼,當然你也可以使用css3構造響應式布局。

  代碼如下:
#plans,#plans ul,#plans ul li {
margin: 0;
padding: 0;
list-style: none;
}

#pricePlans:after {
content: '';
display: table;
clear: both;
}

#pricePlans {
zoom: 1;
}

#pricePlans {
max-width: 69em;
margin: 2em auto;
}

#pricePlans #plans .plan {
background: #fff;
float: left;
text-align: center;
border-radius: 5px;
border:1px solid #d3d3d3;

-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0,0,0,0.1);

width: 23%;
margin: 0 1.33% 20px 0;

-webkit-transition: all .25s;
-moz-transition: all .25s;
-ms-transition: all .25s;
-o-transition: all .25s;
transition: all .25s;
}

#pricePlans #plans .plan:hover {
-webkit-transform: scale(1.04);
-moz-transform: scale(1.04);
-ms-transform: scale(1.04);
-o-transform: scale(1.04);
transform: scale(1.04);
}

.planContainer .title h2 {
font-size: 2.125em;
font-weight: 300;
color: #3e4f6a;
margin: 0;
padding: .6em 0;
}

.planContainer .title h2.bestPlanTitle {
background: #3e4f6a;

background: -webkit-linear-gradient(top, #475975, #364761);
background: -moz-linear-gradient(top, #475975, #364761);
background: -o-linear-gradient(top, #475975, #364761);
background: -ms-linear-gradient(top, #475975, #364761);
background: linear-gradient(top, #475975, #364761);
color: #fff;
border-radius: 5px 5px 0 0;
}


.planContainer .price p {
background: #3e4f6a;

background: -webkit-linear-gradient(top, #475975, #364761);
background: -moz-linear-gradient(top, #475975, #364761);
background: -o-linear-gradient(top, #475975, #364761);
background: -ms-linear-gradient(top, #475975, #364761);
background: linear-gradient(top, #475975, #364761);
color: #fff;
font-size: 1.2em;
font-weight: 700;
height: 2.6em;
line-height: 2.6em;
margin: 0 0 1em;
}

.planContainer .price p.bestPlanPrice {
background: #f7814d;
}

.planContainer .price p span {
color: #8394ae;
}

 

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved