flex上下左右居中
display: flex;
flex-direction: row; // 子元素横向排列 垂直column
justify-content: center; // 水平居中
align-items: center; // 垂直居中
文本超出n行隐藏且显示省略号
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 5; // 超出几行显示省略号,这里就写几
-webkit-box-orient: vertical;
}
border-radius,给某个角单独设置radius
border-top-left-radius // 左上角
border-top-right-radius //右上角
border-bottom-right-radius //右下角
border-bottom-left-radius //左下角
选择相同class名的最后一个js写法
.xxx:last-child{ }
Border 虚线边框
border: 1px dashed red;
<!-- solid 默认实线,dashed 虚线 -->
Css 背景色渐变
background: linear-gradient(to bottom right, yellow, red);
从黄色向红色(右下方向)渐变
如果是向右,就是直接 to right
background: linear-gradient(to bottom right, #FFF3DE, #fff 40%, #fff)
字体斜体
font-style: italic;
字体删除线
text-decoration: line-through;
v-html的图片溢出问题
v-html="内容.replace(/<img/g, '<img style=max-width:100%;height:auto;')"