您的位置:首页 > 新闻 > 热点要闻 > 一些css记录

一些css记录

2024/10/13 1:35:19 来源:https://blog.csdn.net/Pure_White520/article/details/126127093  浏览:    关键词:一些css记录

background-blend-mode

定义了背景层的混合模式(图片与颜色)。菜鸟教程地址
例如:
在这里插入图片描述
在这里插入图片描述

filter 滤镜

background-clip 背景颜色出现位置,是否包含边框

border-box | padding-box | content-box 有点像盒子模型

border-image-source: url(border.png);用图像作为边框

border-image -width属性指定图像边界的宽度。

绘制箭头

在这里插入图片描述

.box {padding: 15px;background-color: #ffffff;border-radius: 6px;display: flex;align-items: center;justify-content: center;
}.arrow {display: inline-block;margin-right: 10px;width: 0;height: 0;/* Base Style */border: 16px solid;border-color: transparent #cddc39 transparent transparent;position: relative;
}.arrow::after {content: "";position: absolute;right: -20px;top: -16px;border: 16px solid;border-color: transparent #fff transparent transparent;
}
/*下*/
.arrow.bottom {transform: rotate(270deg);
}
/*上*/
.arrow.top {transform: rotate(90deg);
}
/*左*/
.arrow.left {transform: rotate(180deg);
}
/*右*/
.arrow.right {transform: rotate(0deg);
}

单行文本溢出时显示省略号

overflow: hidden;white-space: nowrap;text-overflow: ellipsis;max-width: 375px;

多行文本溢出显示省略号

 overflow: hidden;text-overflow: ellipsis;display: -webkit-box;/* set n lines, including 1 */-webkit-line-clamp: 2;-webkit-box-orient: vertical;

页面展示灰色

body{filter: grayscale(1);
}

删除 type="number" 末尾的箭头

.no-arrow::-webkit-outer-spin-button,
.no-arrow::-webkit-inner-spin-button {-webkit-appearance: none;
}

使用 caret-color 来修改光标的颜色

caret-color: #ffd476;

:not选择器

除了最后一个元素外,所有元素都需要一些样式,使用 not 选择器非常容易做到。

li:not(:last-child) {border-bottom: 1px solid #ebedf0;
}

修改 input placeholder 样式

.placehoder-custom::-webkit-input-placeholder {color: #babbc1;font-size: 12px;
}

日期选择器日期图标放在右侧

// 日期选择器日期图标放在右侧
.el-date-editor{.el-input__prefix {left: calc(100% - 26px);}.el-input__suffix{right: 20px;}.el-input__inner{padding-left: 12px;}
}

绘制一个下拉框的样式

.poper-box {box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.06);width: 100%;position: relative;border: 1px solid #E8E8E8;
}.poper-arrow {border-width: 16px;position: absolute;width: 0;height: 0;border-color: transparent;border-style: solid;margin-left: -16px;top: -16px;left: 100px;border-top-width: 0;border-bottom-color: #E8E8E8;
}.poper-arrow::after {content: " ";border-width: 16px;position: absolute;display: block;width: 0;height: 0;border-color: transparent;border-style: solid;top: 1px;margin-left: -16px;border-top-width: 0;border-bottom-color: #fff;transition: 0.1s all;
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com