技術(shù)頻道導(dǎo)航
HTML/CSS
.NET技術(shù)
IIS技術(shù)
PHP技術(shù)
Js/JQuery
Photoshop
Fireworks
服務(wù)器技術(shù)
操作系統(tǒng)
網(wǎng)站運(yùn)營(yíng)

贊助商

分類(lèi)目錄

贊助商

最新文章

搜索

漂亮的CSS響應(yīng)式定價(jià)表,無(wú)需第三方CSS庫(kù)文件

作者:admin    時(shí)間:2023-3-6 20:25:29    瀏覽:

我們?cè)谇懊嬖榻B過(guò)10多款CSS定價(jià)表,不過(guò)它們均需用到至少一個(gè)第三方CSS庫(kù)文件,在本文中,將給大家介紹一個(gè)漂亮的CSS定價(jià)表,無(wú)需第三方CSS庫(kù)文件。

在開(kāi)始之前,你可以看看前面的那些CSS定價(jià)表,它們各種各樣的樣式或許有你喜歡的一款。

實(shí)例介紹

純CSS實(shí)現(xiàn)定價(jià)表,這個(gè)定價(jià)表是響應(yīng)式的,可以適用于任何設(shè)備上。

 

demodownload

HTML代碼

<div class="pricing-table gprice-single">
  <div class="head">
    <h4 class="title">Premium</h4>
</div>
  <div class="content">
    <div class="price">
      <h1>$39</h1>
</div>
    <ul>
      <li>5 GB Ram</li>
      <li>40GB SSD Cloud Storage</li>
      <li>Month Subscription</li>
      <li>Responsive Framework</li>
      <li>Monthly Billing Software</li>
      <li>1 Free Website</li>
    </ul>
    <div class="sign-up">
<a href="#" class="btn bordered radius">Signup Now</a>
</div>
  </div>
</div>

HTML代碼結(jié)構(gòu)并不復(fù)雜,外面一個(gè)div盒子,里面嵌套2層div。

標(biāo)題(class="head")和內(nèi)容(class="content")的div并列關(guān)系。

CSS代碼

.wrapper {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-gap: 15px;
  margin: 50px;
  padding: 0px 20px;
}

.pricing-table {
  box-shadow: 0px 0px 18px #ccc;
  text-align: center;
  padding: 30px 0px;
  border-radius: 5px;
  position: relative;
}

.pricing-table .head {
  border-bottom: 1px solid #eee;
  padding-bottom: 50px;
  transition: all 0.5s ease;
}

.pricing-table:hover .head {
  border-bottom: 1px solid #8E2DE2;
}

.pricing-table .head .title {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 700;
}

.pricing-table .content .price {
  background: linear-gradient(to right, #8E2DE2 0%, #4A00E0 100%);
  width: 90px;
  height: 90px;
  margin: auto;
  line-height: 90px;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: 0px 0px 10px #ccc;
  margin-top: -50px;
  transition: all 0.5s ease;
}

.pricing-table:hover .content .price {
  transform: scale(1.2);
}

.pricing-table .content .price h1 {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
}

.pricing-table .content ul {
  list-style-type: none;
  margin-bottom: 20px;
  padding-top: 10px;
}

.pricing-table .content ul li {
  margin: 20px 0px;
  font-size: 14px;
  color: #555;
}

.pricing-table .content .sign-up {
  background: linear-gradient(to right, #8E2DE2 0%, #4A00E0 100%);
  border-radius: 40px;
  font-weight: 500;
  position: relative;
  display: inline-block;
}

.pricing-table .btn {
  color: #fff;
  padding: 14px 40px;
  display: inline-block;
  text-align: center;
  font-weight: 600;
  -webkit-transition: all 0.3s linear;
  -moz-transition: all 0.3 linear;
  transition: all 0.3 linear;
  border: none;
  font-size: 14px;
  text-transform: capitalize;
  position: relative;
  text-decoration: none;
  margin: 2px;
  z-index: 9999;
  text-decoration: none;
  border-radius: 50px;
}

.pricing-table .btn:hover {
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3);
}

.pricing-table .btn.bordered {
  z-index: 50;
  color: #333;
}

.pricing-table:hover .btn.bordered {
  color: #fff !important;
}

.pricing-table .btn.bordered:after {
  background: #fff none repeat scroll 0 0;
  border-radius: 50px;
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  -webkit-transition: all 0.3s linear;
  -moz-transition: all 0.3 linear;
  transition: all 0.3 linear;
  width: 100%;
  z-index: -1;
  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  transform: scale(1);
}

.pricing-table:hover .btn.bordered:after {
  opacity: 0;
  transform: scale(0);
}

CSS代碼主要對(duì).pricing-table樣式進(jìn)行設(shè)計(jì),有默認(rèn)樣式,盒子設(shè)計(jì)用到box-shadow等屬性,也有鼠標(biāo)懸停(:hover)樣式,用到transformtransition動(dòng)畫(huà)屬性。

總結(jié)

本文介紹的CSS定價(jià)表,它是響應(yīng)式的,適用于任何設(shè)備上使用,無(wú)需第三方CSS庫(kù)文件,CSS樣式設(shè)計(jì)時(shí)沒(méi)有用到非常高深的知識(shí),理解起來(lái)比較容易,而由于無(wú)需用到第三方庫(kù)文件,代碼遷移和使用就變得非常方便。

相關(guān)文章

x