showMore实现卡片文本内容长度限制显示更多折叠按钮效果代码

代码语言:html

所属分类:布局界面

代码描述:showMore实现卡片文本内容长度限制显示更多折叠按钮效果代码

代码标签: 文本 内容 长度 限制 显示 更多 折叠 按钮 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">


    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/showMore.css">


    <style>
        * {
          box-sizing: border-box;
        }
        
        body {
          font-family: system-ui;
          margin: 0;
        }
        
        p {
          font-size: 1.1rem;
          line-height: 150%;
          font-weight: 300;
          margin-top: 0;
          margin-bottom: 0;
          line-clamp: initial;
          -webkit-line-clamp: initial;
          transition-property: -webkit-line-clamp, line-clamp;
          transition-duration: 300;
          transition-timing-function: ease-out;
          overflow: hidden;
        }
        
        .wrapper {
          display: flex;
          height: 100vh;
          justify-content: center;
          align-items: center;
          background: #d9f2ea;
        }
        
        .card {
          background: #fff;
          padding: 24px;
          border-radius: 13px;
          position: relative;
          max-width: 380px;
          margin: 0 12px;
          box-shadow: 0 10px 16px 0 #cde4dd;
        }
        .card .img-wrap {
          padding-bottom: 85%;
          background-image: url("//repo.bfw.wiki/bfwrepo/image/61132edb7fba9.png");
          background-repeat: no-repeat;
          background-size: cover;
          background-position-y: 30%;
          margin-bottom: 1rem;
          border-radius: 5px;
        }
        .card button {
          background: none;
          border: none;
          padding: 0;
          margin-top: 12px;
          color: teal;
          transition: opacity 0.2s ease.........完整代码请登录后点击上方下载按钮下载查看

网友评论0