乐于分享
好东西不私藏

css旅游订票卡片样式布局!!附源码!!

css旅游订票卡片样式布局!!附源码!!

  效果展示  

  完整源码  

HTML
<!DOCTYPE html><htmllang="en" ><head>  <metacharset="UTF-8">  <title>css旅游订票卡片样式布局</title>  <linkrel='stylesheet'href='https://fonts.googleapis.com/css?family=Playfair+Display:700|Raleway:500.700'><linkrel='stylesheet'href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css'>    <linkrel="stylesheet"href="./style.css"></head><body><!-- partial:index.partial.html --><divclass="container">  <divclass="panel">    <divclass="ring">      <divclass="card card1"></div>      <divclass="border">        <pclass="title">Brazil</p>        <divclass="slide">          <h6class="para">Latest Deals from Heathrow</h6>          <divclass="line">            <h6class="para">OUT</h6> <iclass="fa fa-plane"aria-hidden="true"></i>            <h6class="para">£849</h6>          </div>          <divclass="line">            <h6class="para">RTN</h6> <iclass="fa fa-plane"aria-hidden="true"></i>            <h6class="para">£659</h6>          </div>        </div>      </div>    </div>  </div>  <divclass="panel">    <divclass="ring">      <divclass="card card2"></div>      <divclass="border">        <pclass="title">Belize</p>        <divclass="slide">          <h6class="para">Latest Deals from Heathrow</h6>          <divclass="line">            <h6class="para">OUT</h6> <iclass="fa fa-plane"aria-hidden="true"></i>            <h6class="para">£999</h6>          </div>          <divclass="line">            <h6class="para">RTN</h6> <iclass="fa fa-plane"aria-hidden="true"></i>            <h6class="para">£745</h6>          </div>        </div>      </div>    </div>  </div>  <divclass="panel">    <divclass="ring">      <divclass="card card3"></div>      <divclass="border">        <pclass="title">Egypt</p>        <divclass="slide">          <h6class="para">Latest Deals from Heathrow</h6>          <divclass="line">            <h6class="para">OUT</h6> <iclass="fa fa-plane"aria-hidden="true"></i>            <h6class="para">£399</h6>          </div>          <divclass="line">            <h6class="para">RTN</h6> <iclass="fa fa-plane"aria-hidden="true"></i>            <h6class="para">£257</h6>          </div>        </div>      </div>    </div>  </div></div><!-- partial --></body></html>
style.CSS
body {  margin0;  background-color#2e2e31;  display: flex;  align-items: center;  height100vh;  width100vw;}.container {  height100vh;  width100vw;  max-height600px;  max-width1200px;  min-height600px;  min-width1100px;  display: flex;  justify-content: space-around;  align-items: center;  margin0 auto;}.panel {  height270px;  width190px;  position: relative;}.panel:hover .card {  filterblur(1.5px);}.panel:hover .card1 {  background-size215% 135%;}.panel:hover .card2 {  background-size115% 115%;}.panel:hover .card3 {  background-size155% 115%;}.panel:hover .title {  colorrgba(2552552550.2);}.panel:hover .border {  border1px solid white;}.panel:hover .slide {  bottom0px;}.panel:hover .ring:before,.panel:hover .ring:after {  transformtranslateX(-50%translateY(-50%rotate(310deg);}.ring,.card,.border,.slide,.line {  display: flex;  justify-content: center;  align-items: center;}.ring {  color#fffbf1;  position: absolute;  top50%;  left50%;  transformtranslateX(-50%translateY(-50%);  font-size170px;}.card {  background#f0ead6;  position: relative;  transition: all 1s;  height270px;  width190px;  border1px solid white;}.card1 {  background-imageurl("https://assets.codepen.io/489403/brazil.jpg");  background-repeat: no-repeat;  background-size200% 120%;}.card2 {  background-imageurl("https://assets.codepen.io/489403/belize.jpg");  background-repeat: no-repeat;  background-size100% 100%;}.card3 {  background-imageurl("https://assets.codepen.io/489403/egypt.jpg");  background-repeat: no-repeat;  background-size140% 100%;}.ring:before,.ring:after {  content"";  padding0.7em 0.4em;  position: absolute;  left50%;  width115%;  top50%;  display: block;  border5px solid #50c9c3;  border-radius50%;  transition: transform 1s;  transformtranslateX(-50%translateY(-50%rotate(50deg);}.ring:before {  border-color#ebebeb #ebebeb rgba(0000rgba(0000);  z-index: -1;}.ring:after {  border-colorrgba(0000rgba(0000#ebebeb #ebebeb;}p {  text-align: center;  position: absolute;  font-family"Playfair Display";}.title {  font-size36px;  font-weight700;  transition: all 1s;  top0;}.para {  bottom0;  font-size16px;  font-family"Raleway";  padding20px;  margin0;  text-align: center;}.border {  position: absolute;  border1px solid rgba(2552552550.5);  height260px;  width180px;  transition: border 1s;  overflow: hidden;}.slide {  height260px;  width180px;  position: absolute;  border1px solid black;  bottom: -270px;  backgroundrgba(0000.5);  transition: bottom 1s;  flex-direction: column;}.fa-plane {  font-size16px;}