博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
41、css总结
阅读量:4449 次
发布时间:2019-06-07

本文共 1888 字,大约阅读时间需要 6 分钟。

 
 
1、阴影:box-shadow:0 5px 20px rgba(0,0,0,.1);
2、css实现滚动进度条效果:body {
position: relative; padding: 50px; font-size: 24px; line-height: 30px; background-image: linear-gradient(to right top, #ffcc00 50%, #eee 50%); background-size: 100% calc(100% - 100vh + 5px); background-repeat: no-repeat; z-index: 1; } body::after {
content: ""; position: fixed; top: 5px; left: 0; bottom: 0; right: 0; background: #fff; z-index: -1; } 3、//转换(伸缩)transform:scale(1.08);//过渡效果transtion:all .3s ease;4、三角形气泡弹窗
.send {
position: relative;width: 150px;height: 35px;background: #000000;border-radius: 5px;/* 圆角 */margin: 30px auto 0;}.send .arrow {
position: absolute;top: 8px;left: -16px;/* 圆角的位置需要细心调试哦 */width: 0;height: 0;font-size: 0;border: solid 8px;border-color: transparent #000000 transparent transparent;}

 5、几种实现div水平垂直居中的方法:

html:        
123123
css:/* 公共代码 */ .wp {
border: 1px solid red; width: 300px; height: 300px; } .box {
background: green; } .box.size {
width: 100px;height: 100px;}/* 公共代码 */

/* 1、定位代码 */

     .wp {position: relative;}
     .box { position: absolute; top: 50%; left: 50%; margin-left: -50px; margin-top: -50px; }

/* 2、定位代码 */ .wp { position: relative; } .box { position: absolute;; top: 0; left: 0; right: 0; bottom: 0; margin: auto; }

缺点:需要确定子元素宽高

 

/*3、 定位代码 */ .wp {position: relative;}.box {position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);}

flex 不需要确定子元素宽高

/*4、 定位代码 */ 

123123
.wp {    display: flex;    justify-content: center;    align-items: center;}
 

 

转载于:https://www.cnblogs.com/xlfdqf/p/11506502.html

你可能感兴趣的文章
多视几何——三角化求解3D空间点坐标
查看>>
Drag+Drop和MouseClick
查看>>
AWS RDS 使用笔记
查看>>
Puppeteer VS Puppeteer-core
查看>>
Rxjava 执行阻塞的原因分析 tolist() observable.from()等。
查看>>
[转载]解决TCP网络传输“粘包”问题
查看>>
arm裸机驱动错误总结
查看>>
C# 程序性能提升篇-1、装箱和拆箱,枚举的ToString浅析
查看>>
lfs(systemv版本)学习笔记-第3页
查看>>
Postman-简单使用(1)
查看>>
[BJOI2014] 大融合
查看>>
最简单的一个java驱动jdbc链接mysql数据库
查看>>
Laravel 加载第三方类库的方法
查看>>
Binary Tree Level Order Traversal
查看>>
wcf契约版本处理与异常处理(随记)
查看>>
hlg1201Zombie’s Treasure Chest---数学问题
查看>>
1.基础数据类型的初识 字符串 bool 整型 if else elif
查看>>
Mybatis源码分析: MapperMethod功能讲解(1)
查看>>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons.
查看>>
jqGrid的subGrid子表格
查看>>