网站首页 > 知识剖析 正文
js点击下载文件
//点击下载文件写法
const w = window.open('about:blank');
w.location.href='文件url'
PC端中px转vw与vh,sass写法
//PC端 px转vwvh 写法 sass
@function px-vw($px) {
@return $px*100/3840*1vw
}
@function px-vh($px) {
@return $px*100/2160*1vh
}
sass实现纵向滚动条,并改变滚动条样式
//滚动条
height:300px;
overflow-x: hidden;
overflow-y: scroll;
&::-webkit-scrollbar {
width: 5px;
height: 5px;
}
/*定义滚动条轨道 内阴影+圆角*/
&::-webkit-scrollbar-track {
box-shadow: inset 0 0 0px rgba(240, 240, 240, .5);
border-radius: 10px;
}
/*定义滑块 内阴影+圆角*/
&::-webkit-scrollbar-thumb {
border-radius: 10px;
box-shadow: inset 0 0 0px rgba(240, 240, 240, .5);
background-color: #1890ff;
}
css实现竖条背景 内部百分比设置
//竖条背景
background-size:8px;
background-image: linear-gradient(90deg,#52e9ff 50%,#fff);
sass禁止文字换行 在新样式中引用样式
//禁止文字换行
.ellipsis{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
//引用样式class
@extend .ellipsis;
css改变鼠标指针为手型
//改变鼠标指针为手型
cursor: pointer;
css背景样式渐变为透明色
//背景颜色渐变 transparent
background-image: linear-gradient(90deg, red, transparent);
sass中修改引用了antd组件的样式
//sass修改antd样式
:global(.className){}
css取第一个子元素与取最后一个子元素
//css取第一个
&:nth-child{}
&:first-child{}
//css取最后一个
&:last-child{}
js保留一位小数
//保留1位小数
2.01.toFixed(1)
- 上一篇: 常用九宫格布局的几大方法汇总
- 下一篇: 了解CSS Flex:解析实例、用法和案例研究
猜你喜欢
- 2024-11-21 Chrome:2023年CSS增加了哪些功能?
- 2024-11-21 WEB基础面试题——HTML、CSS
- 2024-11-21 手风琴特效这么飒,你能用 JavaScript 实现吗?
- 2024-11-21 css篇四 文本样式(上)
- 2024-11-21 Python Web全栈之旅12--Web前端●CSS扩展知识点汇总,建议收藏
- 2024-11-21 自己动手打造工具系列之自动刷新简历
- 2024-11-21 web前端:CSS的常用属性速查表
- 2024-11-21 css操作之常用技巧
- 2024-11-21 《锋利的jQuery》观后记
- 2024-11-21 了解CSS Flex:解析实例、用法和案例研究
- 最近发表
- 标签列表
-
- xml (46)
- css animation (57)
- array_slice (60)
- htmlspecialchars (54)
- position: absolute (54)
- datediff函数 (47)
- array_pop (49)
- jsmap (52)
- toggleclass (43)
- console.time (63)
- .sql (41)
- ahref (40)
- js json.parse (59)
- html复选框 (60)
- css 透明 (44)
- css 颜色 (47)
- php replace (41)
- css nth-child (48)
- min-height (40)
- xml schema (44)
- css 最后一个元素 (46)
- location.origin (44)
- table border (49)
- html tr (40)
- video controls (49)