CSS
一只小菜鳥
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
css实现元素固定宽高比
css固定元素宽高比原创 2022-08-18 11:37:40 · 4664 阅读 · 1 评论 -
在文字前后加上特殊符号的实现方法
在开发的过程中可能会也遇到一些需求在文字前后加上一些特殊符号,以书名号为例,现在简单说下两种实现方法 js拼接字符串 <div></div> var name = "平凡的世界" name = "《"+ name + "》" $('div').html(name) css伪类 <div></div> div::before{ content: "《"; } div::after{ content: "》"; } $('div').原创 2021-03-09 14:44:51 · 71155 阅读 · 0 评论 -
CSS-文本溢出显示省略号
在开发过程中有时候文本过长会导致页面样式错乱,可以用css将超长文本溢出部分用省略号来显示。 div{ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }原创 2020-12-18 14:29:49 · 193 阅读 · 0 评论 -
css元素子元素自适应大小的两种方法
简单说下css中子元素自适应大小的两种办法 1. 子元素设置百分比 <div class="box"> <div class="content"></div> </div> .box{ margin:100px auto; width: 100px; height: 100px; background: rgba(0, 0, 0, 0.6); } .content{ width: 80%; height: 80%; margin-top: 1原创 2020-12-07 14:36:35 · 4440 阅读 · 0 评论
分享