css
一步一步往前走!
从小白成长......
展开
-
简单的 css 三角形
<div class="box"></div>向上 .box{ width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 0px solid transparent; border-bottom: 30px solid skyblue;}向下.box{ width:原创 2022-03-21 11:24:37 · 57 阅读 · 0 评论 -
文本/文字 溢出隐藏使用...代替
单行文本width: 200px;overflow: hidden;white-space: nowrap; //强制一行显示text-overflow: ellipsis;多行文本width: 200px;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3; //显示的行数overflow: hidden;原创 2022-03-21 10:59:19 · 69 阅读 · 0 评论 -
垂直水平居中css
方案一 ----已知宽度使用position定位布局 + margindiv{ width: 200px; height: 200px; background: red; position: absolute; left: 0; right: 0; bottom: 0; top: 0; margin: auto;}方案二----transform 元素未知宽度使用position定位布局 + transform : translatediv{ backg原创 2020-04-11 15:21:38 · 59 阅读 · 0 评论