11 Star 37 Fork 20

Baryy / You-need-to-know-css

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
single-projection.md 2.13 KB
一键复制 编辑 原始数据 按行查看 历史
LHammer 提交于 2018-04-15 17:41 . :bug:Fixed error words~

常见投影

?> 背景知识::point_right: box-shadow

<script v-pre type="text/x-template" id="single-projection"> <style> main { width: 100%; padding: 20px 0 0 0; } .projection { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #eee; } .projection > div { width: 180px; height: 120px; background: rgba(180,160,120,.2); } .projection:not(:first-child:last-child) > div { border: 2px solid transparent; background-clip: content-box; } .projection:last-child { margin-bottom: 0; border-bottom: 0; } .projection:nth-of-type(1) > div { margin-left: -6px; box-shadow: 0 0 6px rgba(180,160,120,.8); } .projection:nth-of-type(2) > div { border-bottom: 0; box-shadow: 0px 6px 5px -5px rgba(180,160,120,.6); } .projection:nth-of-type(3) > div { border-right: 0; border-bottom: 0; box-shadow: 5px 5px 5px -4px rgba(180,160,120,.6); } .projection:nth-of-type(4) > div { border-right: 0; border-left: 0; box-shadow: 6px 0 5px -5px rgba(180,160,120,.6), -6px 0 5px -5px rgba(180,160,120,.6); } .projection:nth-of-type(5) > div { box-shadow: 0 0 0 1px rgba(180,160,120,.6); } </style>

① 无偏移投影

② 单侧投影

③ 邻边投影

④ 两侧投影

⑤ 1px投影

<script> </script> </script>

浏览器支持

<iframe src="https://caniuse.bitsofco.de/embed/index.html?feat=css-boxshadow&periods=future_1,current,past_1,past_2,past_3&accessible-colours=false" frameborder="0" width="100%" height="436px"></iframe>
CSS
1
https://gitee.com/lhammer/You-need-to-know-css.git
git@gitee.com:lhammer/You-need-to-know-css.git
lhammer
You-need-to-know-css
You-need-to-know-css
master

搜索帮助