惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 聂微东
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
美团技术团队
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
罗磊的独立博客
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
小众软件
小众软件

博客园 - 一丝心情

Volta 安装和使用指南 免费国产ai试用总结 glb格式3d模型压缩 nuxt.js 项目流水线自动部署设置 免费的云数据库 vue 实用指令 IntelliJ IDEA license server 激活(亲测有效) win10/win11专业版激活码(亲测有效) Git 常用指令完全指南 npm 安装依赖报错整理 css3文字渐变, svg文字渐变 http/https与websocket的ws/wss的关系 指令 v-tooltip vue 自定义指令实现v-overflow-tooltip element-ui NavMenu 多级嵌套封装 vue.config.js config.resolve.alias 目录别名配置 three.js 在低版本浏览报THREE.WebGLProgran: shader error 报错解决办法 nuxt 低版本浏览器兼容babel编译配置 常用软件历史版本下载 前端常用指令 数组常用方法总结 vue 中 echarts 添加事件 常用正则
常用css
一丝心情 · 2023-05-09 · via 博客园 - 一丝心情
  1. 单行省略
    /*
    * 强制不换行: white-space: nowrap;
    * 超出隐藏: overflow: hidden
    * 超出的文本显示省略号: text-overflow: ellipsis;
    * 需要设置宽度
    */
    .t-ellipsis {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        /* width: 100%; */
    }
  2. 多行省略
    /*
    * 超出隐藏: overflow:hidden;
    * 超出的文本显示省略号: text-overflow: ellipsis;
    * 设置弹性盒模型: display:-webkit-box;
    * 设置弹性盒子 的子元素的排列方式 : -webkit-box-orient:vertical;
    * 显示文本的最多显示行数:-webkit-line-clamp:3;
    * 需要设置宽度
    */
    .t-ellipsis_3 {
        overflow:hidden;
        text-overflow: ellipsis;
        display:-webkit-box;
        -webkit-box-orient:vertical;
        -webkit-line-clamp:3;
        /* width: 100%; */
    }
  3. flex 弹性布局

    display: flex;

    justify-content: flex-start;

    display: flex;

    justify-content: center;

    display: flex;

    justify-content: flex-end;

    display: flex;

    justify-content: space-between;

    display: flex;

    justify-content: space-around;

    display: flex;

    align-items: flex-start;

    display: flex;

    align-items: center;

    display: flex;

    align-items: flex-end;

    height:auto;

    height:auto;

    height:auto;

    display: flex;

    align-items: stretch;

    1

    2

    display: flex;

    align-items: baseline;

    display: flex;

    justify-content: flex-start;

    align-items: flex-start;

    display: flex;

    justify-content: center;

    align-items: center;

    display: flex;

    justify-content: center;

    align-items: flex-end;

    display: flex;

    justify-content: flex-end;

    align-items: flex-end;

    display: flex;

    justify-content: flex-end;

    align-items: center;

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    display: flex;

    justify-content: space-between;

    align-items: center;

    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    flex: 1;

    flex: 2;

    flex: 1;

    display: flex;

    justify-content: space-around;

    align-items: flex-start;

    display: flex;

    justify-content: space-around;

    align-items: center;

    display: flex;

    justify-content: space-around;

    align-items: flex-end;

    display: flex;

    flex-wrap: wrap;

    align-content: flex-start;

    display: flex;

    flex-wrap: wrap;

    align-content: center;

    display: flex;

    flex-wrap: wrap;

    align-content: flex-end;

    display: flex;

    flex-wrap: wrap;

    align-content: stretch;

    display: flex;

    flex-wrap: wrap;

    align-content: space-between;

    display: flex;

    flex-wrap: wrap;

    align-content: space-around;


        .flex { display: flex; }
        .flex-item_flex-1 { flex: 1; }
        .flex-item_flex-2 { flex: 2; }
        .flex-item_flex-a { width: auto; }
    
        .flex-justify_start { display: flex; justify-content: flex-start; }
        .flex-justify_center { display: flex; justify-content: center; }
        .flex-justify_end { display: flex; justify-content: flex-end; }
        .flex-justify_space-between { display: flex; justify-content: space-between; }
        .flex-justify_space-around { display: flex; justify-content: space-around; }
    
        .flex-align_start { display: flex; align-items: flex-start; }
        .flex-align_end { display: flex; align-items: flex-end; }
        .flex-align_center { display: flex; align-items: center; }
        .flex-align_stretch { display: flex; align-items: stretch; }
        .flex-align_baseline { display: flex; align-items: baseline; }
    
        .flex_start_start { display: flex; justify-content: flex-start; align-items: flex-start; }
        .flex_center_center { display: flex; justify-content: center; align-items: center; }
        .flex_end_end { display: flex; justify-content: flex-end; align-items: flex-end; }
        .flex_center_end { display: flex; justify-content: center; align-items: flex-end; }
        .flex_end_center { display: flex; justify-content: flex-end; align-items: center; }
        .flex_space-between_start { display: flex; justify-content: space-between; align-items: flex-start; }
        .flex_space-between_center { display: flex; justify-content: space-between; align-items: center; }
        .flex_space-between_end { display: flex; justify-content: space-between; align-items: flex-end; }
        .flex_space-around_start { display: flex; justify-content: space-around; align-items: flex-start; }
        .flex_space-around_center { display: flex; justify-content: space-around; align-items: center; }
        .flex_space-around_end { display: flex; justify-content: space-around; align-items: flex-end; }
    
        [class*=flex-align-content_] { display: flex; flex-wrap: wrap; }
        .flex-align-content_start { align-content: flex-start; }
        .flex-align-content_center { align-content: center; }
        .flex-align-content_end { align-content: flex-end; }
        .flex-align-content_stretch { align-content: stretch; }
        .flex-align-content_space-between { align-content: space-between; }
        .flex-align-content_space-around { align-content: space-around; }
  4. css 动画

posted @ 2023-05-09 16:59  一丝心情  阅读(81)  评论()    收藏  举报