Как создать ценовую карту со скользящей анимацией с помощью HTML и CSS

В этом руководстве вы узнаете, как создать карточку с ценами со скользящей анимацией, используя только HTML и CSS. Ценовая карточка - это элемент дизайна на коммерческом веб-сайте для отображения различных тарифных планов, подписок или сравнения цен.

Для создания этой программы [CSS Pricing Card Design]. Во-первых, вам нужно создать два файла: один файл HTML, а другой - файл CSS.

Сначала создайте HTML-файл с именем index.html.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Pure CSS Pricing Cards | Codequs</title>
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
</head>
<body>
  <div class="wrapper">
    <input type="radio" name="slider" id="tab-1">
    <input type="radio" name="slider" id="tab-2" checked>
    <input type="radio" name="slider" id="tab-3">
    <header>
      <label for="tab-1" class="tab-1">Basic</label>
      <label for="tab-2" class="tab-2">Standard</label>
      <label for="tab-3" class="tab-3">Team</label>
      <div class="slider"></div>
    </header>
    <div class="card-area">
      <div class="cards">
        <div class="row row-1">
          <div class="price-details">
            <span class="price">19</span>
            <p>For beginner use</p>
          </div>
          <ul class="features">
            <li><i class="fas fa-check"></i><span>100 GB Premium Bandwidth</span></li>
            <li><i class="fas fa-check"></i><span>FREE 50+ Installation Scripts WordPress Supported</span></li>
            <li><i class="fas fa-check"></i><span>One FREE Domain Registration .com and .np extensions only</span></li>
            <li><i class="fas fa-check"></i><span>Unlimited Email Accounts & Databases</span></li>
          </ul>
        </div>
        <div class="row">
          <div class="price-details">
            <span class="price">99</span>
            <p>For professional use</p>
          </div>
          <ul class="features">
            <li><i class="fas fa-check"></i><span>Unlimited GB Premium Bandwidth</span></li>
            <li><i class="fas fa-check"></i><span>FREE 200+ Installation Scripts WordPress Supported</span></li>
            <li><i class="fas fa-check"></i><span>Five FREE Domain Registration .com and .np extensions only</span></li>
            <li><i class="fas fa-check"></i><span>Unlimited Email Accounts & Databases</span></li>
          </ul>
        </div>
        <div class="row">
          <div class="price-details">
            <span class="price">49</span>
            <p>For team collaboration</p>
          </div>
          <ul class="features">
            <li><i class="fas fa-check"></i><span>200 GB Premium Bandwidth</span></li>
            <li><i class="fas fa-check"></i><span>FREE 100+ Installation Scripts WordPress Supported</span></li>
            <li><i class="fas fa-check"></i><span>Two FREE Domain Registration .com and .np extensions only</span></li>
            <li><i class="fas fa-check"></i><span>Unlimited Email Accounts & Databases</span></li>
          </ul>
        </div>
      </div>
    </div>
    <button>Choose plan</button>
  </div>
</body>
</html>

Во-вторых, создайте файл CSS с именем style.css

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@700&family=Poppins:wght@400;500;600&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(#D5A3FF 0%, #77A5F8 100%);
}
.wrapper{
  width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 10px 10px 15px rgba(0,0,0,0.05);
}
.wrapper header{
  height: 55px;
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 30px;
  position: relative;
}
header label{
  height: 100%;
  z-index: 2;
  width: 30%;
  display: flex;
  cursor: pointer;
  font-size: 18px;
  position: relative;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}
#tab-1:checked ~ header .tab-1,
#tab-2:checked ~ header .tab-2,
#tab-3:checked ~ header .tab-3{
  color: #fff;
}
header label:nth-child(2){
  width: 40%;
}
header .slider{
  position: absolute;
  height: 85%;
  border-radius: inherit;
  background: linear-gradient(145deg, #D5A3FF 0%, #77A5F8 100%);
  transition: all 0.3s ease;
}
#tab-1:checked ~ header .slider{
  left: 0%;
  width: 90px;
  transform: translateX(5%);
}
#tab-2:checked ~ header .slider{
  left: 50%;
  width: 120px;
  transform: translateX(-50%);
}
#tab-3:checked ~ header .slider{
  left: 100%;
  width: 95px;
  transform: translateX(-105%);
}
.wrapper input[type="radio"]{
  display: none;
}
.card-area{
  overflow: hidden;
}
.card-area .cards{
  display: flex;
  width: 300%;
}
.cards .row{
  width: 33.4%;
}
.cards .row-1{
  transition: all 0.3s ease;
}
#tab-1:checked ~ .card-area .cards .row-1{
   margin-left: 0%;
}
#tab-2:checked ~ .card-area .cards .row-1{
  margin-left: -33.4%;
}
#tab-3:checked ~ .card-area .cards .row-1{
   margin-left: -66.8%;
}
.row .price-details{
  margin: 20px 0;
  text-align: center;
  padding-bottom: 25px;
  border-bottom: 1px solid #e6e6e6;
}
.price-details .price{
  font-size: 65px;
  font-weight: 600;
  position: relative;
  font-family: 'Noto Sans', sans-serif;
}
.price-details .price::before,
.price-details .price::after{
  position: absolute;
  font-weight: 400;
  font-family: "Poppins", sans-serif;
}
.price-details .price::before{
  content: "$";
  left: -13px;
  top: 17px;
  font-size: 20px;
}
.price-details .price::after{
  content: "/mon";
  right: -33px;
  bottom: 17px;
  font-size: 13px;
}
.price-details p{
  font-size: 18px;
  margin-top: 5px;
}
.row .features li{
  display: flex;
  font-size: 15px;
  list-style: none;
  margin-bottom: 10px;
  align-items: center;
}
.features li i{
  background: linear-gradient(#D5A3FF 0%, #77A5F8 100%);
  background-clip: text;
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
}
.features li span{
  margin-left: 10px;
}
.wrapper button{
  width: 100%;
  border-radius: 25px;
  border: none;
  outline: none;
  height: 50px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  margin-top: 20px;
  background: linear-gradient(145deg, #D5A3FF 0%, #77A5F8 100%);
  transition: transform 0.3s ease;
}
.wrapper button:hover{
  transform: scale(0.98);
}

Теперь вы успешно создали дизайн ценовой карточки на чистом CSS!

What is GEEK

Buddha Community

anita maity

anita maity

1618667723

Sidebar Menu Using Only HTML and CSS | Side Navigation Bar

how to create a Sidebar Menu using HTML and CSS only. Previously I have shared a Responsive Navigation Menu Bar using HTML & CSS only, now it’s time to create a Side Navigation Menu Bar that slides from the left or right side.

Demo

#sidebar menu using html css #side navigation menu html css #css side navigation menu bar #,pure css sidebar menu #side menu bar html css #side menu bar using html css

Alisha  Larkin

Alisha Larkin

1617789060

HTML Tutorial For Beginners

The prospect of learning HTML can seem confusing at first: where to begin, what to learn, the best ways to learn — it can be difficult to get started. In this article, we’ll explore the best ways for learning HTML to assist you on your programming journey.

What is HTML?

Hypertext Markup Language (HTML) is the standard markup language for documents meant to be displayed in a web browser. Along with Cascading Style Sheets (CSS) and JavaScript, HTML completes the trio of essential tools used in creating modern web documents.

HTML provides the structure of a webpage, from the header and footer sections to paragraphs of text, videos, and images. CSS allows you to set the visual properties of different HTML elements, like changing colors, setting the order of blocks on the screen, and defining which elements to display. JavaScript automates changes to HTML and CSS, for example, making the font larger in a paragraph when a user clicks a button on the page.

#html #html-css #html-fundamentals #learning-html #html-css-basics #html-templates

anita maity

anita maity

1621077133

Responsive Footer Design using HTML, CSS & Bootstrap

Hello Readers, welcome to my other blog, today in this blog I’m going to create a Responsive Footer by using HTML & CSS only. Earlier I have shared How to create a Responsive Navigation Menu and now it’s time to create a footer section.

As you can see on the image which is given on the webpage. There are various important topics there like About us, Our services and subscribes, some social media icons, and a contact section for easy connection. I want to tell you that it is fully responsive. Responsive means this program is fit in all screen devices like tablet, small screen laptop, or mobile devices.

Live Demo


#responsive footer html css template #footer design in html #simple footer html css code #simple responsive footer codepen #responsive footer code in html and css #responsive footer html css codepen

Как создать ценовую карту со скользящей анимацией с помощью HTML и CSS

В этом руководстве вы узнаете, как создать карточку с ценами со скользящей анимацией, используя только HTML и CSS. Ценовая карточка - это элемент дизайна на коммерческом веб-сайте для отображения различных тарифных планов, подписок или сравнения цен.

Для создания этой программы [CSS Pricing Card Design]. Во-первых, вам нужно создать два файла: один файл HTML, а другой - файл CSS.

Сначала создайте HTML-файл с именем index.html.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Pure CSS Pricing Cards | Codequs</title>
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
</head>
<body>
  <div class="wrapper">
    <input type="radio" name="slider" id="tab-1">
    <input type="radio" name="slider" id="tab-2" checked>
    <input type="radio" name="slider" id="tab-3">
    <header>
      <label for="tab-1" class="tab-1">Basic</label>
      <label for="tab-2" class="tab-2">Standard</label>
      <label for="tab-3" class="tab-3">Team</label>
      <div class="slider"></div>
    </header>
    <div class="card-area">
      <div class="cards">
        <div class="row row-1">
          <div class="price-details">
            <span class="price">19</span>
            <p>For beginner use</p>
          </div>
          <ul class="features">
            <li><i class="fas fa-check"></i><span>100 GB Premium Bandwidth</span></li>
            <li><i class="fas fa-check"></i><span>FREE 50+ Installation Scripts WordPress Supported</span></li>
            <li><i class="fas fa-check"></i><span>One FREE Domain Registration .com and .np extensions only</span></li>
            <li><i class="fas fa-check"></i><span>Unlimited Email Accounts & Databases</span></li>
          </ul>
        </div>
        <div class="row">
          <div class="price-details">
            <span class="price">99</span>
            <p>For professional use</p>
          </div>
          <ul class="features">
            <li><i class="fas fa-check"></i><span>Unlimited GB Premium Bandwidth</span></li>
            <li><i class="fas fa-check"></i><span>FREE 200+ Installation Scripts WordPress Supported</span></li>
            <li><i class="fas fa-check"></i><span>Five FREE Domain Registration .com and .np extensions only</span></li>
            <li><i class="fas fa-check"></i><span>Unlimited Email Accounts & Databases</span></li>
          </ul>
        </div>
        <div class="row">
          <div class="price-details">
            <span class="price">49</span>
            <p>For team collaboration</p>
          </div>
          <ul class="features">
            <li><i class="fas fa-check"></i><span>200 GB Premium Bandwidth</span></li>
            <li><i class="fas fa-check"></i><span>FREE 100+ Installation Scripts WordPress Supported</span></li>
            <li><i class="fas fa-check"></i><span>Two FREE Domain Registration .com and .np extensions only</span></li>
            <li><i class="fas fa-check"></i><span>Unlimited Email Accounts & Databases</span></li>
          </ul>
        </div>
      </div>
    </div>
    <button>Choose plan</button>
  </div>
</body>
</html>

Во-вторых, создайте файл CSS с именем style.css

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@700&family=Poppins:wght@400;500;600&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(#D5A3FF 0%, #77A5F8 100%);
}
.wrapper{
  width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 10px 10px 15px rgba(0,0,0,0.05);
}
.wrapper header{
  height: 55px;
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 30px;
  position: relative;
}
header label{
  height: 100%;
  z-index: 2;
  width: 30%;
  display: flex;
  cursor: pointer;
  font-size: 18px;
  position: relative;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}
#tab-1:checked ~ header .tab-1,
#tab-2:checked ~ header .tab-2,
#tab-3:checked ~ header .tab-3{
  color: #fff;
}
header label:nth-child(2){
  width: 40%;
}
header .slider{
  position: absolute;
  height: 85%;
  border-radius: inherit;
  background: linear-gradient(145deg, #D5A3FF 0%, #77A5F8 100%);
  transition: all 0.3s ease;
}
#tab-1:checked ~ header .slider{
  left: 0%;
  width: 90px;
  transform: translateX(5%);
}
#tab-2:checked ~ header .slider{
  left: 50%;
  width: 120px;
  transform: translateX(-50%);
}
#tab-3:checked ~ header .slider{
  left: 100%;
  width: 95px;
  transform: translateX(-105%);
}
.wrapper input[type="radio"]{
  display: none;
}
.card-area{
  overflow: hidden;
}
.card-area .cards{
  display: flex;
  width: 300%;
}
.cards .row{
  width: 33.4%;
}
.cards .row-1{
  transition: all 0.3s ease;
}
#tab-1:checked ~ .card-area .cards .row-1{
   margin-left: 0%;
}
#tab-2:checked ~ .card-area .cards .row-1{
  margin-left: -33.4%;
}
#tab-3:checked ~ .card-area .cards .row-1{
   margin-left: -66.8%;
}
.row .price-details{
  margin: 20px 0;
  text-align: center;
  padding-bottom: 25px;
  border-bottom: 1px solid #e6e6e6;
}
.price-details .price{
  font-size: 65px;
  font-weight: 600;
  position: relative;
  font-family: 'Noto Sans', sans-serif;
}
.price-details .price::before,
.price-details .price::after{
  position: absolute;
  font-weight: 400;
  font-family: "Poppins", sans-serif;
}
.price-details .price::before{
  content: "$";
  left: -13px;
  top: 17px;
  font-size: 20px;
}
.price-details .price::after{
  content: "/mon";
  right: -33px;
  bottom: 17px;
  font-size: 13px;
}
.price-details p{
  font-size: 18px;
  margin-top: 5px;
}
.row .features li{
  display: flex;
  font-size: 15px;
  list-style: none;
  margin-bottom: 10px;
  align-items: center;
}
.features li i{
  background: linear-gradient(#D5A3FF 0%, #77A5F8 100%);
  background-clip: text;
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
}
.features li span{
  margin-left: 10px;
}
.wrapper button{
  width: 100%;
  border-radius: 25px;
  border: none;
  outline: none;
  height: 50px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  margin-top: 20px;
  background: linear-gradient(145deg, #D5A3FF 0%, #77A5F8 100%);
  transition: transform 0.3s ease;
}
.wrapper button:hover{
  transform: scale(0.98);
}

Теперь вы успешно создали дизайн ценовой карточки на чистом CSS!

Как создать кнопку «Читать больше и меньше» с помощью HTML и CSS

Читать дальше Читать меньше Кнопку  Мы видим почти на всех сайтах. Этот тип кнопки обычно находится на главной странице веб-сайта. В этой статье вы шаг за шагом узнаете, как создать HTML-код «читай больше-меньше». 

Здесь HTML, CSS и jQuery используются для  создания кнопки «Читать больше/Читать меньше» . В предыдущем уроке я показал вам, как  создать адаптивный дизайн нижнего колонтитула

Много раз я вижу большую информацию на веб-сайте и вижу кнопку. Когда вы нажмете на эту кнопку, вы увидите полную информацию.

HTML-код кнопки «Подробнее»

Ниже приведен предварительный просмотр, из которого вы можете узнать, как работает эта  кнопка читать больше читать меньше jquery  . Здесь использовано небольшое количество jQuery, так что у вас не возникнет проблем с пониманием.

Как вы можете видеть выше, на веб-странице был создан ящик. В это поле добавлено много текста. Некоторые из этих текстов можно увидеть. 

Есть кнопка (кнопка «Читать больше и меньше»). При нажатии на кнопку виден весь текст. Вы можете использовать другую информацию вместо этого текста.

Как создать кнопку «Читать больше» «Читать меньше»

Не беспокойтесь, если вы хотите создать эту кнопку «Читать больше и меньше». Здесь вы найдете весь исходный код и  информацию о том, как сделать HTML-кнопку «Подробнее»

Для его создания вам необходимо создать файл HTML CSS и javascript. Здесь я дал весь исходный код.

HTML-код кнопки «Подробнее»

Следующий код представляет собой HTML-код, который я использовал для добавления всей информации. Скопируйте следующий код и добавьте его в свой HTML-файл. Обязательно переименуйте свой HTML-файл, используя index.html.

<!DOCTYPE html>
<html lang=“en”>
<head>

  <meta name=“viewport” content=“width=device-width, initial-scale=1.0”>
  <meta http-equiv=“X-UA-Compatible” content=“ie=edge”>

  <!– css cdn link –>
  <link rel=“stylesheet” href=“style.css”>
</head>

<body>
  <div class=“wrapper”>
      <div class=“title”>Show More & Show Less Button </div>
      <ul>
          <li>Lorem ipsum dolor sit amet.</li>

          <li>Lorem ipsum dolor sit amet consectetur adipisicing elit.</li>
          <li>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vitae necessitatibus consequatur quae doloribus eaque quod cumque? Modi, impedit, deserunt pariatur accusantium commodi magnam eos, qui debitis officiis obcaecati ut voluptatum.</li>
          <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Blanditiis, ex?</li>
          <li>Lorem, ipsum.</li>
          <li>Lorem ipsum dolor sit amet consectetur adipisicing elit.</li>
          <li>Lorem ipsum dolor sit.</li>
          <li>Lorem ipsum dolor sit amet consectetur adipisicing elit. Blanditiis, ex?</li>
          <li>Lorem, ipsum.</li>
      </ul>
      <div class=“toggle_btn”>
          <span class=“toggle_text”>Show More</span> <span class=“arrow”>
        <i class=“fas fa-angle-down”></i>
        </span>
      </div>
  </div>

<!–javascript cdn link–>
  <script type="rocketlazyloadscript" src=“https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js” charset=“utf-8”></script>
  <script type="rocketlazyloadscript" src=“https://kit.fontawesome.com/b99e675b6e.js”></script>
  <!– javascript code–>

  <!–
    <script type="rocketlazyloadscript">
      add javascript code
    </script>
  –>
<script>class RocketElementorAnimation{constructor(){this.deviceMode=document.createElement("span"),this.deviceMode.id="elementor-device-mode",this.deviceMode.setAttribute("class","elementor-screen-only"),document.body.appendChild(this.deviceMode)}_detectAnimations(){let t=getComputedStyle(this.deviceMode,":after").content.replace(/"/g,"");this.animationSettingKeys=this._listAnimationSettingsKeys(t),document.querySelectorAll(".elementor-invisible[data-settings]").forEach(t=>{const e=t.getBoundingClientRect();if(e.bottom>=0&&e.top<=window.innerHeight)try{this._animateElement(t)}catch(t){}})}_animateElement(t){const e=JSON.parse(t.dataset.settings),i=e._animation_delay||e.animation_delay||0,n=e[this.animationSettingKeys.find(t=>e[t])];if("none"===n)return void t.classList.remove("elementor-invisible");t.classList.remove(n),this.currentAnimation&&t.classList.remove(this.currentAnimation),this.currentAnimation=n;let s=setTimeout(()=>{t.classList.remove("elementor-invisible"),t.classList.add("animated",n),this._removeAnimationSettings(t,e)},i);window.addEventListener("rocket-startLoading",function(){clearTimeout(s)})}_listAnimationSettingsKeys(t="mobile"){const e=[""];switch(t){case"mobile":e.unshift("_mobile");case"tablet":e.unshift("_tablet");case"desktop":e.unshift("_desktop")}const i=[];return["animation","_animation"].forEach(t=>{e.forEach(e=>{i.push(t+e)})}),i}_removeAnimationSettings(t,e){this._listAnimationSettingsKeys().forEach(t=>delete e[t]),t.dataset.settings=JSON.stringify(e)}static run(){const t=new RocketElementorAnimation;requestAnimationFrame(t._detectAnimations.bind(t))}}document.addEventListener("DOMContentLoaded",RocketElementorAnimation.run);</script></body>
</html>

CSS-код кнопки «Показать больше»

Теперь вы должны использовать CSS, чтобы создать эту  кнопку читать больше читать меньше . Ниже я привел все коды CSS. Вы копируете эти коды и добавляете их в свой файл CSS. 

Здесь у меня есть файлы CSS и javascript, связанные с файлом HTML. Однако, конечно, используйте переименование style.css вашего файла CSS.

*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Montserrat', sans-serif;
}

body{
background: #0c7788;
font-size: 14px;
line-height: 22px;
}

.wrapper{
width: 500px;
margin: 50px auto 0;
background: #fff;
padding: 30px 40px;
border-radius: 3px;
box-shadow: 1px 1px 2px rgba(0,0,0,0.125);
}

.wrapper .title{
font-weight: 700;
margin-bottom: 15px;
font-size: 18px;
text-align: center;
}

.wrapper  ul{
  height: 120px;
  overflow: hidden;
  padding-left: 15px;
}

.wrapper  ul.active{
height: auto;
}

.wrapper  ul li{
margin-bottom: 5px;
list-style: none;
position: relative;
}

.wrapper  ul li:before{
  content: "";
  position: absolute;
  top: 8px;
  left: -12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bfbfbf;
}

.wrapper .toggle_btn{
margin-top: 15px;
font-weight: 700;
color: #ffffff;
cursor: pointer;
margin-left: 70%;
font-size: 15px;
padding: 10px;
border-radius: 5px;
background: rgb(204, 12, 79);
}

.wrapper .toggle_btn.active .fas{
transform: rotate(180deg);
}

JavaScript (index.js)

Теперь пришло время активировать эту  простую кнопку «Читать меньше» и «Читать больше»  , используя некоторое количество JQuery. 

Для этого создайте файл JavaScript и добавьте в него следующий код. Я уже добавил ссылку jquery CDN в HTML-код, чтобы активировать этот jquery.

$(".toggle_btn").click(function(){
   $(this).toggleClass("active");
  $(".wrapper ul").toggleClass("active");

  if($(".toggle_btn").hasClass("active")){
    $(".toggle_text").text("Show Less");
  }
  else{
    $(".toggle_text").text("Show More");
  }
});

Надеюсь, используя приведенный выше код, вы смогли создать эти  кнопки «Читать меньше» и «Читать больше» . Если есть какие-либо проблемы, используйте кнопку загрузки ниже. 

Все исходные коды прикреплены вместе в этой кнопке. Пожалуйста, прокомментируйте, как вам нравится эта  HTML-кнопка «читать дальше» .

Исходный код

Оригинальный источник статьи: https://foolishdeveloper.com/

#css #html #button