HTML-CSS练习例子

news2024/12/27 16:04:38

HTML CSS 练习

https://icodethis.com

作为前端练习生。不敲代码只看,入门是很慢的,所以直接实战是学习前端最快的途径之一。 这个网站练习HTML
CSS的,可以打开了解一下,可以每天打卡,例子简单,循序渐进,设计的也比较好看。

下面是练习,当然布局的方法有很多,下面是一种。

01基础

这是第一个练习,但是很多大佬做出了,很多不一样的效果
比如:

在这里插入图片描述

在这里插入图片描述

设计稿

在这里插入图片描述

代码

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>基础练习</title>
  <style>
    .main {
      width: 400px;
      height: 100%;
      margin: 0 auto;
      /* padding-top: 30px; */
      padding: 0 10px;
      /* background-color: rgba(241, 77, 186, 0.5); */
    }

    .content {
      padding-top: 30px;
    }

    p {
      margin: 0;
    }

    .group {
      margin-top: 15px;
    }

    .title {
      display: inline-block;
      /* padding: 5px ; */
      font-size: 15px;
      font-weight: 600;
      text-align: center;
      padding: 0 10px;
      /* margin-bottom: 20px; */
      box-shadow: 0 2px 3px #7b7878;
      border-radius: 3px;
      background-color: #d9d9d9;
    }

    .my-custom-font-Arial {
      /* @font-face 加载外部字体 */
      /* 'Artal': 这是首选的字体,也就是开发者希望文本显示的字体。'Artal'是一个具体的字体名称,假设它是一个自定义字体或者是用户系统中已安装的字体。如果浏览器在用户的系统中找到了这个字体,它就会使用这个字体来渲染文本。 */
      font-family: 'Arial', sans-serif;
    }

    .my-custom-font-Roman {
      font-family: 'Roman', sans-serif;
    }

    .font-underlined {
      text-decoration: underline;
    }

    .font-through {
      text-decoration: line-through;
    }

    h1,
    h2,
    h3 {
      margin: 0;
    }

    .color-box {
      margin-top: 10px;
    }

    .color-orange {
      color: #ee5531;
    }

    .square {
      width: 50px;
      height: 50px;
      background-color: #ee5531;
    }

    .color-purple {
      color: #4621ab;
    }

    .circular {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background-color: #4621ab;
    }

    h6 {
      margin: 0;
      margin-bottom: 3px;
    }

    .button-box {
      margin-top: 10px;
    }

    button {
      display: inline-block;
      width: 150px;
      height: 30px;
      border: none;
      color: #fff;
      background-color: #4621ab;
      border-radius: 2px;
    }

    /* 鼠标悬停时 */
    button:hover {
      background-color: #866cdc;
    }

    /* 点击时(按下状态) */
    button:active {
      background-color: #cfc4f1;
    }
  </style>
</head>

<body>
  <div class="main">
    <div class="content">
      <!-- TYPOGRAPHY -->
      <div class="title">TYPOGRAPHY</div>
      <div>
        <div class="group">
          <p><strong>Make me bold</strong></p>
          <p><em>Make me italic</em></p>
        </div>

        <div class="group">
          <p class="my-custom-font-Arial">I'm from the Artal font famil!</p>
          <p class="my-custom-font-Roman">And I'm frorm the Times New Ronan fot family! .</p>
        </div>

        <div class="group">
          <p class="font-underlined">Make this text be underlined</p>
          <p class="font-through">And put a Hine through this one</p>
        </div>

      </div>

    </div>

    <div class="content">
      <!-- HEADINGS -->
      <div class="title">HEADINGS</div>
      <div>
        <div>
          <h1>This isa &lt;h1&gt; tag</h1>
          <h2>This isa&lt;h2&gt;tag</h2>
          <h3>This isa &lt;h3&gt;tag</h3>
        </div>
      </div>
    </div>

    <div class="content">
      <!-- COLORS -->
      <div class="title">COLORS</div>
      <div>
        <div class="color-box">
          <div class="color-orange">Color me orange!</div>
          <div class="color-orange square"></div>
        </div>

        <div class="color-box">
          <div class="color-purple">Color me purple!</div>
          <div class="color-purple circular"></div>
        </div>
      </div>
    </div>

    <div class="content">
      <!-- BUTTONS -->
      <div class="title">BUTTONS</div>
      <div>
        <div class="button-box">
          <h6>Defult</h6>
          <button>Button</button>
        </div>

        <div class="button-box">
          <h6>Hovered</h6>
          <button>Button</button>
        </div>

        <div class="button-box">
          <h6>Active</h6>
          <button>Button</button>
        </div>
      </div>
    </div>


  </div>
</body>

</html>

02_404页面

设计搞

在这里插入图片描述

代码

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .main {
      /* border: 1px solid #000; */
      position: relative;
      width: 100%;
      /* 或者设置一个固定宽度 */
      height: 100%;
      /* 或者设置一个固定高度 */
    }

    .main-box {
      position: absolute;
      top: 50%;
      /* 使子元素的上边缘位于父元素的中心 */
      left: 50%;
      /* 使子元素的左边缘位于父元素的中心 */
      transform: translate(-50%, 20%);
      /* 调整位置,使其居中 */
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 800px;
      height: 500px;
      /* margin: 100px auto; */
      /* background-color: rgba(241, 77, 186, 0.5); */
      background-image: linear-gradient(to right, #f073c6, #ff6b96);
      border-radius: 8px;
      border: 2px solid black;
      box-shadow: 0 8px 15px rgba(230, 41, 135, 0.5);

    }

    .content {
      width: 50%;
      text-align: center;
      color: #fff;
      /* background-color: rgb(227, 153, 57);
      border: 1px solid black; */

    }

    .one {
      margin: 50px 0;
    }

    .two {
      margin: 0 0 20px 0;
      font-size: 100px;
      font-weight: 700;
    }

    .three {
      margin: 0 0 30px 0;
    }

    .four {
      vertical-align: bottom;
    }

    a {
      color: #fff;
      text-decoration: none;
      border-bottom: 1px solid #fff;
    }

    .circular-box {
      position: absolute;
      width: 800px;
      height: 500px;
      top: 50%;
      /* 使子元素的上边缘位于父元素的中心 */
      left: 50%;
      /* 使子元素的左边缘位于父元素的中心 */
      transform: translate(-50%, 20%);
      /* 调整位置,使其居中 */
      background-color: rgba(241, 77, 186, 0.2);
      overflow: hidden;
    }

    .circular {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      /* background-color: #fff; */

    }

    .circular-box> :nth-child(1) {
      width: 200px;
      height: 200px;
      position: absolute;
      top: 70%;
      /* 使子元素的上边缘位于父元素的中心 */
      left: -5%;
      background-image: linear-gradient(55deg, rgba(255, 255, 255, 0.137), rgba(242, 114, 193, 0.342));
    }

    .circular-box> :nth-child(2) {
      width: 300px;
      height: 300px;
      position: absolute;
      top: -10%;
      /* 使子元素的上边缘位于父元素的中心 */
      left: 75%;
      background-image: linear-gradient(-55deg, rgba(255, 255, 255, 0.137), rgba(242, 114, 193, 0.342));
    }

    .circular-box> :nth-child(3) {
      width: 100px;
      height: 100px;
      position: absolute;
      top: 60%;
      /* 使子元素的上边缘位于父元素的中心 */
      left: 75%;
      background-image: linear-gradient(328deg, rgba(255, 255, 255, 0.137), rgba(242, 114, 193, 0.342));
    }
  </style>
</head>

<body>
  <div class="main">
    <div class="main-box">
      <div class="content one">UIDesignDally</div>
      <div class="content two">404</div>
      <div class="content three">The link you clicked may be broken or the<br/>
        page may have been removed.</div>
      <div class="content four">Visit the <a href="">home page</a> or <a href="">contact</a>me</div>
    </div>

    <div class="circular-box">
      <div class="circular"></div>
      <div class="circular"></div>
      <div class="circular"></div>
    </div>
  </div>
</body>

</html>

代码2

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./index2.css">
</head>

<body>
  <div class="container">
    <div class="content">
      <div class="circle1"></div>
      <div class="circle2"></div>
      <div class="circle3"></div>
      <p>UIDesignDaily</p>
      <h1>404</h1>
      <h3>The link you clicked may be broken or the <br> page may have been removed.</h3>
      <h5>Visit the <a href="">home page</a> or <a href="">contact</a> me</h5>
    </div>
  </div>

</body>

</html>
/*index2.css*/
body{
  margin: 0;
  padding: 0;
}

.container{
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.content{
  overflow: hidden;
  width:95%;
  height: calc(80%/1.4);
  background-image: linear-gradient(90deg, rgb(239,115,199), rgb(255,106,149));
  border: 3px solid rgb(36,46,76);
  border-radius: 13px;
  display:flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 2px 10px 10px rgba(239, 115, 200, 0.534);
}
.circle1{
  width:250px;
  height: 250px;
  background-image: linear-gradient(270deg, rgba(255, 255, 255, 0.308), rgba(242, 114, 193, 0));
  border-radius: 250px;
  position:absolute;
  left:-40px;
  top:300px;
}

.circle2{
  width:250px;
  height: 250px;
  background-image: linear-gradient(270deg, rgba(255, 255, 255, 0.308), rgba(242, 114, 193, 0));
  border-radius: 250px;
  position:absolute;
  right:-70px;
  top:-50px;
}
.circle3{
  width:70px;
  height: 70px;
  background-image: linear-gradient(270deg, rgba(255, 255, 255, 0.308), rgba(242, 114, 193, 0));
  border-radius: 70px;
  position:absolute;
  left:70%;
  top:50%;
}
p{
  font-size: 10px;
  padding-top: 50px;
  font-family:'Open Sans';
  color:rgba(255, 255, 255, 0.719);
}

h1{
  font-size: 120px;
  font-weight: 600;
  font-family:'Open Sans';
  color:white;
}

h3{
  font-size: 11px;
  font-weight: 501;
  text-align: center;
  font-family:'Open Sans';
  color:rgba(255, 255, 255, 0.685);
}

h5{
  font-size: 10px;
  padding-top: 30px;
  font-family:'Open Sans';
  color:rgba(255, 255, 255, 0.664);
}

a{
  text-decoration: underline;
}

03_Christmas Promo

设计稿

在这里插入图片描述

代码

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div class="container">
    <div class="content">
      <div class="x"></div>
      <img src="https://i.postimg.cc/J0GVNJFy/tree.png" alt="">
      <h5>Merry Christmas !</h5>
      <p class="tasks">You completed all your Decenber's tasks<br />
        50 we decided to get you a gift:</p>
      <p class="plan">50% off on your Yearly Premium Plan</p>
      <button>GET YOUR GIFT</button>
    </div>
  </div>
</body>

</html>
/* Write your CSS code here */body {
    padding: 0;
    margin: 0;
}

.container {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #eff0f3;
    /* border: 1px solid red;   */
}

.content {
    position: relative;
    background-color: #fff;
    width: 400px;
    height: 450px;
    border-radius: 4px;
    border-top-right-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 4px 10px 10px rgba(53, 64, 99, 0.1);
}

.x {
    position: absolute;
    width: 10px;
    height: 10px;
    right: 20px;
    top: 20px;
    font-size: 20px;
    transform: rotate(45deg);
}

.x::after,
.x::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: rgb(123, 122, 122);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.x::before {
    transform: translate(-50%, -50%) rotate(90deg);
}

img {
    margin-top: 70px;
    width: 100px;
    height: 130px;
}

/* .tasks{
  text-align: center;
} */
.tasks {
    font-size: 12px;
    color: rgb(126, 125, 123);
    text-align: center;
}

.plan {
    color: orange;
    font-size: 13px;
}

button {
    color: white;
    width: 170px;
    height: 40px;
    margin: 30px;
    font-size: 12px;
    background-color: #242e4c;
    border-radius: 5px;
    box-shadow: 1px 5px 5px rgba(36, 46, 76, 0.5);
}

04_Subscribe

设计稿

在这里插入图片描述

代码

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./index.css">
</head>

<body>
  <div class="container">
    <div class="content">
      <h4>Let's keep in touch</h4>
      <p class="Subscribe">Subscribe to keep up with fresh news and exciting updates.<br />
        We promise not to spam youl!</p>
      <form action="">
        <input class="email" type="text" placeholder="Enter your email address">
        <button class="email-button">SEND &nbsp;</button>
      </form>
      <p class="checkbox-box">
        <input id="checkbox1" class="input-checkbox" type="checkbox">
        <label for="checkbox1">I agree to my email address being stored and<br />used to reccive monthly ncwsletter.</label>
      </p>
    </div>
  </div>
</body>

</html>
body {
  padding: 0;
  margin: 0;
}

.container {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f2f5f8;
  /* border: 1px solid red; */
}

.content {
  /* position: relative; */
  background-color: #fff;
  width: 600px;
  height: 300px;
  border-radius: 7px;
  box-shadow: 0px 10px 10px rgba(61, 159, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.Subscribe {
  font-size: 14px;
  text-align: center;
}

.email {
  width: 230px;
  height: 35px;
  border-radius: 5px;
  padding-left: 15px;
  margin-right: 5px;
  margin-top: 20px;
  border: 1px solid rgb(212, 214, 217);
}

.email-button {
  width: 150px;
  height: 40px;
  color: #fff;
  font-size: 13px;
  border-radius: 5px;
  border: 1px solid rgb(212, 214, 217);
  background-color: rgb(61, 159, 255);
  box-shadow: 0px 5px 5px rgba(61, 159, 255, 0.3);
}

.email-button:hover {
  background-color: rgb(12, 122, 231);
  box-shadow: 0px 5px 5px rgba(61, 159, 255, 0.3);
}

.checkbox-box {
  margin-left: -110px;
}

.input-checkbox {
  display: none;
  /* 隐藏原生的checkbox ,自定义checkbox*/
}
.checkbox-box label {
  position: relative;
  padding-left: 10px;
  cursor: pointer;
  display: inline-block;
  font-size: 12px;
  color: #787f85;
}

.checkbox-box label:before {
  content: '';
  position: absolute;
  left: -15px;
  top: 0;
  width: 15px;
  height: 15px;
  border: 1px solid rgb(212, 214, 217);
  border-radius: 3px;
}

   /* 当checkbox被选中时的样式 */
   .checkbox-box input[type="checkbox"]:checked+label:before {
    background-color: #3d9fff;
    /* 背景颜色,可选 */
}
.checkbox-box input[type="checkbox"]:checked+label:after {
  content: "\2713";
  position: absolute;
  left: -12px;
  top: 0px; 
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

05_Toasts

设计稿

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./index2.css">
</head>

<body>
  <section class="toast-wrapper">

    <div class="toast">
      <div class="icon-wrapper">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
              stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
              class="icon icon-tabler icons-tabler-outline icon-tabler-check">
              <path stroke="none" d="M0 0h24v24H0z" fill="none" />
              <path d="M5 12l5 5l10 -10" />
          </svg>
      </div>

      <p>File has been removerd succesfully!</p>

      <button class="close-btn">
          <svg  xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="currentColor"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"  class="icon icon-tabler icons-tabler-outline icon-tabler-x"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>
      </button>
  </div>


    <div class="toast toast-dark">
      <div class="icon-wrapper">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-check">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M5 12l5 5l10 -10" />
        </svg>
      </div>

      <p>File has been removerd succesfully!</p>

      <button class="close-btn">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-x">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M18 6l-12 12" />
          <path d="M6 6l12 12" />
        </svg>
      </button>
    </div>


    <div class="toast toast-rounded">
      <div class="icon-wrapper">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-check">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M5 12l5 5l10 -10" />
        </svg>
      </div>

      <p>File has been removerd succesfully!</p>

      <button class="close-btn">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-x">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M18 6l-12 12" />
          <path d="M6 6l12 12" />
        </svg>
      </button>
    </div>




    <div class="toast toast-dark toast-rounded">
      <div class="icon-wrapper">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-check">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M5 12l5 5l10 -10" />
        </svg>
      </div>

      <p>File has been removerd succesfully!</p>

      <button class="close-btn">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-x">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M18 6l-12 12" />
          <path d="M6 6l12 12" />
        </svg>
      </button>
    </div>


    <div class="toast toast-loading">
      <div class="icon-wrapper">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-check">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M5 12l5 5l10 -10" />
        </svg>
      </div>

      <p>File has been removerd succesfully!</p>

    </div>


    <div class="toast toast-dark toast-loading">
      <div class="icon-wrapper">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
          stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
          class="icon icon-tabler icons-tabler-outline icon-tabler-check">
          <path stroke="none" d="M0 0h24v24H0z" fill="none" />
          <path d="M5 12l5 5l10 -10" />
        </svg>
      </div>

      <p>File has been removerd succesfully!</p>
    </div>

  </section>
</body>

</html>

代码

*{
  box-sizing: border-box;
}

body{
  background: #f5edfd;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
}

.toast-wrapper{
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 800px; 
}
.toast{
  background: #ffffff;
  box-shadow: 0 5px 5px -4px rgba(0, 0, 0, 0.3);
  color: #110024;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  width: 100%;
}

.toast-dark{
  background: #110024;
  color: #ffffff;
}

.toast.toast-rounded{
  border-radius: 50px;
}

.toast.toast-loading{
  --loading-width: 40%;
  position: relative;
  justify-content: center;
}

.toast.toast-loading::after{
  content: '';
  background: #110024;
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: var(--loading-width);
}

.toast.toast-dark.toast-loading::after{
  background: #ffffff;
}

.toast .icon-wrapper{
  background: #2ca12c;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
}

.toast-dark .icon-wrapper{
  background: #ffffff;
  color: #2ca12c;
}

.toast .close-btn{
  background: none;
  border: none;
  color: #9b9b9b;
  cursor: pointer;
  margin-left: auto;
  padding: 0;
}

06_BirthdayList

设计稿

在这里插入图片描述

代码

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./index.css">
</head>

<body>
  <section class="list-wrapper">
    <h3 class="list">24 birthdays today</h3>
    <div class="list"> <img src="./image1.png" alt=""><div class="list-name"><span>Bertie Yates</span> <span>29 years</span></div></div>
    <div class="list"> <img src="./image1.png" alt=""><div class="list-name"><span>Hester Hogan</span> <span>32 years</span></div></div>
    <div class="list"> <img src="./image1.png" alt=""><div class="list-name"><span>LorryLttle</span> <span>32 years</span></div></div>
    <div class="list"> <img src="./image1.png" alt=""><div class="list-name"><span>Bertie Yates</span> <span>29 years</span></div></div>
    <div class="list"> <img src="./image1.png" alt=""><div class="list-name"><span>Bertie Yates</span> <span>29 years</span></div></div>
    <div class="list"><button>View all</button></div>
  </section>
</body>

</html>
* {
    box-sizing: border-box;
}

body {
    background: #f089b1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-height: 100vh;
}

.list-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 40px;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 70px 50px 40px rgb(226, 112, 158);
    gap: 1.2rem;
    width: 30%;
    /* height: 30rem; */
    max-width: 700px;
    overflow: hidden;
}

h3 {
    font-weight: normal;
    white-space: nowrap;
    margin: 0;
}

.list {
    width: 100%;
    display: flex;
    align-items: center;
}

.list img {
    min-width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: aqua;
    margin-right: 8px;
}

.list-name {
    display: flex;
    flex-direction: column;
}

.list-name span:nth-of-type(2) {
    font-size: 13px;
    color: #9b9899;
}

button {
    width: 100%;
    height: 40px;
    color: #fff;
    border: none;
    border-radius: 0.2em;
    background-image: linear-gradient(to right, #e76ecf, #fe69a4);
    box-shadow: 0px 5px 4px rgba(246, 89, 194, 0.3);
}

07_Pricing Table

设计稿

在这里插入图片描述

代码

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./index.css">
</head>

<body>

  <div class="table-wrapper">
    <div class="halo purple"></div>
    <div class="halo blue"></div>
    <div class="halo yellow"></div>
  
    <ul class="table-list">
      <li>
        <h3>Free</h3>
        <div class="list-price"><span><span>$</span> <span>0</span></span></div>
        <p class="list-pack">Free oyour whole team</p>
        <p>For individuals or teams looking to organize anything.</p>
        <button>Get started</button>
      </li>
      <li>
        <h3>Standard</h3>
        <div class="list-price"><span><span>$</span> <span>6</span></span></div>
        <p class="list-pack">Peruser per month</p>
        <p>For teams that need to manage more work.</p>
        <button>Upgrade Now</button>
      </li>
      <li>
        <h3>Premium</h3>
        <div class="list-price"><span><span>$</span> <span>12</span></span></div>
        <p class="list-pack">Peruser per month</p>
        <p>Best for teams that need to track multiple projects.</p>
        <button>Try for free</button>
      </li>
    </ul>
  </div>
</body>

</html>

* {
  box-sizing: border-box;
}

body {
  background-color: #f5f8ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
}

li {
  list-style: none;
  /* 移除列表项前的符号 */
  margin: 0;
  /* 重置外边距 */
  padding: 0;
  /* 重置内边距 */
}

.table-wrapper {
  position: relative;
  min-height: 50vh;
  min-width: 625px;
  border: 15px solid #fff;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, .7);
  /* overflow: hidden; */
}

.table-list {
  display: flex;
  gap: 2rem;
  max-width: 800px;
}

.list-price span:nth-of-type(1) {
  font-size: 20px;
  font-weight: bold;
}

.list-price span:nth-of-type(2) {
  font-size: 40px;
  font-weight: bold;
}

p {
  font-size: 18px;
}

.list-pack {
  margin: 0;
  font-size: 12px;

}

button {
  border: none;
  width: 7rem;
  height: 40px;
  border-radius: 5px;

}

.table-list li:nth-of-type(1) button {
  background-color: #edbbff;
}

.table-list li:nth-of-type(2) button {
  background-color: #aef1f5;
}

.table-list li:nth-of-type(3) button {
  background-color: #ffddb6;
}

.halo {
  position: absolute;
  top: 4rem;
  left: 20rem;
  /* background-color: #edbbff; */
  width: 15rem;
  height: 15rem;
  border-radius: 50%;

}

.purple {
  /* position: absolute; */
  top: 13rem;
  left: -8rem;
  width: 20rem;
  height: 20rem;
  /* background-color: #edbbff; */
  background-image: radial-gradient(circle, rgba(237, 187, 255, 1) 0%, rgba(237, 187, 255, 0) 100%);
  box-shadow: 0 20px 70px rgba(237, 187, 255, 0.2),
      /* 下阴影 */
      0 -20px 70px rgba(237, 187, 255, 0.2),
      /* 上阴影 */
      20px 0 70px rgba(237, 187, 255, 0.2),
      /* 右阴影 */
      -20px 0 70px rgba(237, 187, 255, 0.2);
  /* 左阴影 */
  z-index: -5;
}

.blue {
  /* background-color: #aef1f5; */
  top: -6rem;
  left: 10rem;
  background-image: radial-gradient(circle, rgba(174, 241, 245, 1) 0%, rgba(237, 187, 255, 0) 100%);
  box-shadow: 0 20px 70px rgba(174, 241, 245, 0.2),
      /* 下阴影 */
      0 -20px 70px rgba(174, 241, 245, 0.2),
      /* 上阴影 */
      20px 0 70px rgba(174, 241, 245, 0.2),
      /* 右阴影 */
      -20px 0 70px rgba(174, 241, 245, 0.2);
  /* 左阴影 */
  z-index: -5;
}

.yellow {
  top: -3rem;
  left: 40rem;
  /* background-color: #ffddb6; */
  background-image: radial-gradient(circle, rgba(255, 221, 182, 1) 0%, rgba(237, 187, 255, 0) 100%);
  box-shadow: 0 20px 70px rgba(255, 221, 182, 0.2),
      /* 下阴影 */
      0 -20px 70px rgba(255, 221, 182, 0.2),
      /* 上阴影 */
      20px 0 70px rgba(255, 221, 182, 0.2),
      /* 右阴影 */
      -20px 0 70px rgba(255, 221, 182, 0.2);
  /* 左阴影 */
  z-index: -5;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1806381.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

《TCP/IP网络编程》(第十三章)多种I/O函数(2)

使用readv和writev函数可以提高数据通信的效率&#xff0c;它们的功能可以概括为**“对数据进行整合传输及发送”**。 即使用writev函数可以将分散在多个缓冲中的数据一并发送&#xff0c;使用readv函数可以由多个缓冲分别接受&#xff0c;所以适当使用他们可以减少I/O函数的调…

Pytorch 实现目标检测一(Pytorch 23)

一 目标检测和边界框 在图像分类任务中&#xff0c;我们假设图像中只有一个主要物体对象&#xff0c;我们只关注如何识别其类别。然而&#xff0c;很多时候图像里有多个我们感兴趣的目标&#xff0c;我们不仅想知 道它们的类别&#xff0c;还想得到它们在图像中的具体位置。在…

ESP8266+STM32+阿里云保姆级教程(AT指令+MQTT)

前言&#xff1a;在开发过程中&#xff0c;几乎踩便了所有大坑小坑总结出的文章&#xff0c;我是把坑踩满了&#xff0c;帮助更过小白快速上手&#xff0c;如有错误之处&#xff0c;还麻烦各位大佬帮忙指正、 目录 一、ESP-01s介绍 1、ESP-01s管脚功能&#xff1a; 模组启动模…

vscode 突然无法启动 WSL terminal 了怎么办?

参考&#xff1a;https://github.com/microsoft/vscode/issues/107485 根据参考网页&#xff0c;似乎在 windows 更新之后&#xff0c;重启&#xff0c;就有可能出现标题所说的 vscode 无法启动 WSL terminal 的情况。 首先使用 cmd 进入 wsl 终端&#xff0c;把 ~/.vscode-se…

EON安装ASE Interface

EON安装 我的eon路径于/eon/。 则环境为 export PYTHONPATH/eon/:$PYTHONPATH export PATH/eon/bin:$PATHsource: https://theory.cm.utexas.edu/eon/installation.html ASE 测试系统ubuntu。如果你python2和python3总是纠缠不清&#xff0c;可以sudo apt install python-…

vscode中执行python语句dir(torch)不返回结果

输入半天&#xff0c;发现在IDLE运行后的shell界面输入语句就会返回一大串。但是在vscode中老是不返回值。 结果恍然发现这没加print&#xff08;&#xff09;。 无语惨了。 家人们&#xff0c;这是python&#xff0c;而不是matlab。思维还没转换过来&#xff0c;笑死

扩散模型Stable Diffusion

扩散模型构成 Text Encoder(CLIPText) Clip Text为文本编码器。以77 token为输入&#xff0c;输出为77 token 嵌入向量&#xff0c;每个向量有768维度。 Diffusion(UNetScheduler) 在潜在空间中逐步处理扩散信息。以文本嵌入向量和由噪声组成的起始多维数组为输入&#xff0c…

二叉树—leetcode

前言 本篇博客我们来仔细说一下二叉树二叉树的一些OJ题目 请看完上一篇&#xff1a;数据结构-二叉树-CSDN博客 &#x1f493; 个人主页&#xff1a;普通young man-CSDN博客 ⏩ 文章专栏&#xff1a;LeetCode_普通young man的博客-CSDN博客 若有问题 评论区见&#x1f4dd; &…

Zynq7000 系列FPGA模块化仪器

• 基于 XilinxXC7Z020 / 010 / 007S • 灵活的模块组合 • 易于嵌入的紧凑型外观结构 • 高性能的 ARM Cortex 处理器 • 成熟的 FPGA 可编程逻辑 &#xff0c;基于 IP 核的软件库 FPGA 控制器 Zynq7000 系列模块是基于 Xilinx XC7Z020/010/007S 全可编程片上系统 (SoC) 的…

LLM的基础模型8:深入注意力机制

大模型技术论文不断&#xff0c;每个月总会新增上千篇。本专栏精选论文重点解读&#xff0c;主题还是围绕着行业实践和工程量产。若在某个环节出现卡点&#xff0c;可以回到大模型必备腔调或者LLM背后的基础模型新阅读。而最新科技&#xff08;Mamba,xLSTM,KAN&#xff09;则提…

[ue5]建模场景学习笔记(5)——必修内容可交互的地形,交互沙(3)

1.需求分析&#xff1a; 我们现在已经能够让这片地形出现在任意地方&#xff0c;只要角色走在这片地形上&#xff0c;就能够产生痕迹&#xff0c;但这片区域总是需要人工指定&#xff0c;又无法把这片区域无限扩大&#xff08;显存爆炸&#xff09;&#xff0c;因此尝试使角色无…

【BUG】已解决:Could not find a version that satisfies the requirement tensorflow

已解决&#xff1a;Could not find a version that satisfies the requirement tensorflow 欢迎来到我的主页&#xff0c;我是博主英杰&#xff0c;211科班出身&#xff0c;就职于医疗科技公司&#xff0c;热衷分享知识&#xff0c;同时是武汉城市开发者社区主理人 擅长.net、C…

Java抽象队列同步器AQS

AQS介绍 AQS是一个抽象类&#xff0c;主要用来构建锁和同步器。 public abstract class AbstractQueuedSynchronizer extends AbstractOwnableSynchronizer implements java.io.Serializable { }AQS为构建锁和同步器提供了一些通用功能的实现&#xff0c;因此&#xff0c;使用…

基于STM32开发的智能语音助理系统

⬇帮大家整理了单片机的资料 包括stm32的项目合集【源码开发文档】 点击下方蓝字即可领取&#xff0c;感谢支持&#xff01;⬇ 点击领取更多嵌入式详细资料 问题讨论&#xff0c;stm32的资料领取可以私信&#xff01; 目录 引言环境准备智能语音助理系统基础代码实现&#xff…

BFS实现图的点的层次-java

加强对广度优先搜索的理解&#xff0c;其实就是主要的3个步骤&#xff0c;外加数组模拟单链表是基础&#xff0c;要搞懂。 目录 前言 一、图中点的层次 二、算法思路 1.广度优先遍历 2.算法思路 三、代码如下 1.代码如下&#xff08;示例&#xff09;&#xff1a; 2.读入…

【Python教程】2-函数、逻辑运算与条件判断

在整理自己的笔记的时候发现了当年学习python时候整理的笔记&#xff0c;稍微整理一下&#xff0c;分享出来&#xff0c;方便记录和查看吧。个人觉得如果想简单了解一名语言或者技术&#xff0c;最简单的方式就是通过菜鸟教程去学习一下。今后会从python开始重新更新&#xff0…

0基础学习区块链技术——入门

大纲 区块链构成区块链相关技术Hash算法区块链区块链交易 参考资料 本文力求简单&#xff0c;不讨论任何技术细节&#xff0c;只是从简单的组成来介绍区块链技术&#xff0c;以方便大家快速入门。同时借助一些可视化工具&#xff0c;辅助大家有直观的认识。 区块链构成 顾名思…

一文掌握Vue3:深度解读Vue3新特性、Vue2与Vue3核心差异以及Vue2到Vue3转型迭代迁移重点梳理与实战

每次技术革新均推动着应用性能与开发体验的提升。Vue3 的迭代进步体现在性能优化、API重构与增强型TypeScript支持等方面&#xff0c;从而实现更高效开发、更优运行表现&#xff0c;促使升级成为保持竞争力与跟进现代前端趋势的必然选择。本文深度解读Vue3 响应式数据data、生命…

④-1单细胞学习-cellchat单数据代码补充版

目录 1&#xff0c;数据输入及处理 ①载入包和数据 ②CellChat输入数据准备 ③构建CellChat对象 ④数据预处理 2&#xff0c;细胞通讯预测 ①计算细胞通讯概率 ②提取配受体对细胞通讯结果表 ③提取信号通路水平的细胞通讯表 ④细胞互作关系可视化 1&#xff09;细胞…

服务器部署spring项目jar包使用bat文件,省略每次输入java -jar了

echo off set pathC:\Program Files\Java\jre1.8.0_191\bin START "YiXiangZhengHe-8516" "%path%/java" -Xdebug -jar -Dspring.profiles.activeprod -Dserver.port8516 YiXiangZhengHe-0.0.1-SNAPSHOT.jar 将set path后面改成jre的bin文件夹 START 后…