box-shadow

CSS3 学习笔记(边框 背景 字体 图片 旋转等)

╄→гoц情女王★ 提交于 2019-12-03 09:49:50
边框    盒子圆角  border-radius:5px / 20%;         border-radius:5px 4px 3px 2px; 左上,右上,右下,左下   盒子阴影  box-shadow:box-shadow:x轴偏移量 y轴偏移量 阴影模糊半径(阴影颜色的模糊程度) 阴影扩展半径 阴影颜色 投影方式               注意:inset 是指阴影在盒子内部,默认在外部,inset写到第一个或者最后一个参数位置,其他位置是无效的          值有3个时,表示距离左侧、距离上侧、影子颜色 值有4个时,表示距离左侧、距离上侧、虚化的像素、影子颜色         值有5个时,表示距离左侧、距离上侧、虚化的像素、影子颜色、是否显示在内部并且将颜色进行反转         负值时,在相反的方向 背景   背景尺寸 background-size auto默认值,不改变图片的大小 长度值 200px 50px 代表宽高依次是200 50  百分比 同长度值 cover填充整个外层容器   背景平铺  background-repeat   背景位置  位置定位1(background-origin) 根据文本位置:content-box 根据边框位置:border-box 根据内边距位置:padding-box 使用这个属性,必须设置背景为no

Box Shadow in Firefox

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a problem with box-shadow in Firefox - it "lags": This is my CSS: - moz - box - shadow : 0 0 5px #333; - webkit - box - shadow : 0 0 5px #333; box - shadow : 0 0 5px #333; In Chrome, it works normally (without "lag"), but in Firefox it's slow. How can I fix this? 回答1: This has been a known bug in Firefox for years. Box-shadow can cause slow scrolling or, when you are animating an element to which box-shadow is assigned, Firefox can crawl. The fix is to eiher restrict blur radius to 10px or filter out the box-shadow from

CSS3 Box shadow size – percent units?

一个人想着一个人 提交于 2019-12-03 07:27:40
问题 I'm working on a project that needs to use CSS3 box-shadow property. That's fine, but I have found out that spread size of shadow can't be set to a percentage of parent object. I fully understand that box-shadow is not additive, thus it doesn't take the size of a parent as a reference. But given the fact that I need to have a fully responsive site with objects scaling fluidly (not only on breakpoints), but this also poses a problem – I can set shadow to spread property only in absolute units

CSS Shadows all four sides of div

和自甴很熟 提交于 2019-12-03 07:16:38
I want to achieve this in CSS - not CSS3 as I want it to be supported by all browsers ie a div containing content, with the shadows on every side. The top area will be used for navigation. I have searched for tutorials but so far to no avail. Help! As Ventus said is not possible to use css shadows with ie (only ie9). But you can use shadowOn . It's a great jquery plugin and very easy in use. With it you will have cross browser compatibility. Box Shadow works in all mordern [IE>8] browsers, This code uses no images and works in all browsers in IE versions below 9. box-shadow:2px 2px 10px 10px

CSS 常用技巧

空扰寡人 提交于 2019-12-03 02:45:47
本文转载于: 猿2048 网站➸ https://www.mk2048.com/blog/blog.php?id=hikii1c2ab 概述 相信大家在写css属性的时候,会遇到一些问题,比如说:垂直对齐,垂直居中,背景渐变动画,表格宽度自适应,模糊文本,样式重置,清除浮动,通用媒体查询,自定义选择文本,强制出现滚动条,固定头部和页脚,自己在网上看到的一篇关于css的文章,感觉这里边一些常用的css代码片段对大家很有帮助,所以我就把这篇文章分享给大家,希望大家能够喜欢。 css代码片段 1、垂直对齐 如果你用 CSS ,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用 CSS3 的 Transform ,可以很优雅的解决这个困惑: .verticalcenter{ position: relative; top: 50%; -webkit-transform: translateY(-50%); -o-transform: translateY(-50%); transform: translateY(-50%); } 使用这个技巧,从单行文本、段落到box,都会垂直对齐。目前浏览器对 Transform 的支持是需要关注的, Chrome 4 , Opera 10 , Safari 3 , Firefox 3 , and Internet Explorer 9 均支持该属性

Creating a CSS3 box-shadow on all sides but one

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got a tabbed navigation bar where I'd like the open tab to have a shadow to set it apart from the other tabs. I'd also like the whole tab section to have a single shadow (see bottom horizontal line) going up, shading the bottom of all tabs except for the open one. I'm going to use CSS3's box-shadow property to do it, but I can't figure out a way to shade only the parts I want. Normally I'd cover up the bottom shadow of the open tab with the content area (higher z-index ), but in this case the content area itself has a shadow so that

How to get box-shadow on left & right sides only

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Any way to get box-shadow on left & right (horizontal?) sides only with no hacks or images. I am using: box-shadow: 0 0 15px 5px rgba(31, 73, 125, 0.8); But it gives shadow all around. I have no borders around the elements. 回答1: NOTE: I suggest checking out @Hamish's answer below; it doesn't involve the imperfect "masking" in the solution described here. You can get close with multiple box-shadows; one for each side box-shadow: 12px 0 15px -4px rgba(31, 73, 125, 0.8), -12px 0 8px -4px rgba(31, 73, 125, 0.8); http://jsfiddle.net/YJDdp/ Edit

CSS 阴影动画优化技巧一则

谁说胖子不能爱 提交于 2019-12-03 02:19:10
原文: CSS 阴影动画优化技巧一则 本技巧来自这篇文章 -- How to animate box-shadow with silky smooth performance 本文不是直译,因为觉得这个技巧很有意思很有用,遂起一文。 box-shaodw 在我们的工作中使用以及越来越多,伴随阴影的动画或多或少都有一点。假设,我们有下面这样一个盒子: ? 1 2 3 4 5 div { width : 100px ; height : 100px ; box-shadow: 0 2px 4px rgba( 0 , 0 , 0 , 0.3 ); } 希望 hover 的时候,盒阴影从 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) 过渡到 box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) 。 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) --> box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) OK,最简单的方法当然是: ? 1 2 3 4 div:hover { width : 100px ; box-shadow: 0 5px 15px rgba( 0 , 0 , 0 , 0.3 ); } 因为过渡动画是在两个不同的盒阴影状态在发生

Box Shadow on table row not appearing on certain browsers

匿名 (未验证) 提交于 2019-12-03 02:15:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: CSS box-shadow on table rows - tr - doesn't seem to be working consistently across browsers. On some browsers the shadow is displayed; on others, there is no shadow. I'm using the following CSS: tr { background-color: rgb(165, 182, 229); box-shadow: 0px 2px 2px black; -moz-box-shadow: 0px 2px 2px black; -webkit-box-shadow: 0px 2px 2px black; } td, th { padding: 5px; text-align: left; } Here is a jsFiddle of the below snippet: tr { background-color: rgb(165, 182, 229); box-shadow: 0px 2px 2px black; -moz-box-shadow: 0px 2px 2px black, ;

Double curved shape

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am currently attempting to generate a 'wavy ghostly bottom' shape. This shape contains two double curves: Although the bottom part of this image I think portrays it in better imagery. My Code My Current Attempt to generate this shape was using pseudo elements and overflow: hidden , although this does not allow for a gradient background (would require a plain background): Attempt 1 - Using Pseudo Elements with overflow hidden .bottom { height: 300px; width: 300px; background: lightgray; position: relative; overflow: hidden; margin-top: