ja_*_*him 12 css line shadow shapes fadeout
我是最小化图像使用的忠实粉丝,并且想知道是否有人使用纯静态CSS创建这种类型的策略(或者是否可能)?
http://www.flickr.com/photos/jahimandahalf/6780397612/
我指的是一条似乎越来越瘦的线条和它下面的阴影效果.
我当时认为用三角形做一个CSS形状技巧是可能的:
http://css-tricks.com/snippets/css/css-triangle/
或者使用'transform'在box-shadow上旋转:
zenelements.com/blog/css3-transform/
有任何想法吗?
为了重现该水平规则,您可以使用 CSS3 线性渐变。只需创建一个大约 3px 高度的 div 并应用以下 CSS(根据需要更改颜色):
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(left, #ffffff 0%, #2989d8 25%, #207cca 75%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#ffffff), color-stop(25%,#2989d8), color-stop(75%,#207cca), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #ffffff 0%,#2989d8 25%,#207cca 75%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #ffffff 0%,#2989d8 25%,#207cca 75%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #ffffff 0%,#2989d8 25%,#207cca 75%,#ffffff 100%); /* IE10+ */
background: linear-gradient(left, #ffffff 0%,#2989d8 25%,#207cca 75%,#ffffff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */
Run Code Online (Sandbox Code Playgroud)
请记住,filter它不支持颜色停止,因此您可能希望图像在 < IE10 后退。
在此处构建您自己的 CSS3 渐变:http : //www.colorzilla.com/gradient-editor/
好的,我已经回答了我自己的问题,但我已经阅读了Stackoverflow论坛,它似乎是可以接受的(如果不是真的鼓励!)
所以...
HTML:
<html>
<head>
<TITLE>TEST</TITLE>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<div id="wrap">
<div id="gradient">
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
CSS:
#wrap
{
overflow:hidden;
height:10px;
width:600px;
height:20px;
margin:auto;
margin-top:200px;
}
#gradient
{
height:20px;
width:580px;
margin:auto;
margin-top:-11px;
background: -moz-radial-gradient(center, ellipse cover, rgba(10,10,10,1) 0%, rgba(8,8,8,1) 19%, rgba(3,3,3,0) 80%, rgba(1,1,1,0) 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(10,10,10,1)), color-stop(19%,rgba(8,8,8,1)), color-stop(80%,rgba(3,3,3,0)), color-stop(100%,rgba(1,1,1,0))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, rgba(10,10,10,1) 0%,rgba(8,8,8,1) 19%,rgba(3,3,3,0) 80%,rgba(1,1,1,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, rgba(10,10,10,1) 0%,rgba(8,8,8,1) 19%,rgba(3,3,3,0) 80%,rgba(1,1,1,0) 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, rgba(10,10,10,1) 0%,rgba(8,8,8,1) 19%,rgba(3,3,3,0) 80%,rgba(1,1,1,0) 100%); /* IE10+ */
background: radial-gradient(center, ellipse cover, rgba(10,10,10,1) 0%,rgba(8,8,8,1) 19%,rgba(3,3,3,0) 80%,rgba(1,1,1,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0a0a0a', endColorstr='#00010101',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
Run Code Online (Sandbox Code Playgroud)
hr {
height: 1px;
margin: 50px 0;
background: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(0, 0, 0, 0)), color-stop(0.5, #333333), to(rgba(0, 0, 0, 0)));
background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0), #333333, rgba(0, 0, 0, 0));
background: -moz-linear-gradient(left, rgba(0, 0, 0, 0), #333333, rgba(0, 0, 0, 0));
background: -o-linear-gradient(left, rgba(0, 0, 0, 0), #333333, rgba(0, 0, 0, 0));
background: linear-gradient(left, rgba(0, 0, 0, 0), #333333, rgba(0, 0, 0, 0));
border: 0;
}
hr:after {
display: block;
content: '';
height: 30px;
background-image: -webkit-gradient(radial, 50% 0%, 0, 50% 0%, 116, color-stop(0%, #cccccc), color-stop(100%, rgba(255, 255, 255, 0)));
background-image: -webkit-radial-gradient(center top, farthest-side, #cccccc 0%, rgba(255, 255, 255, 0) 100%);
background-image: -moz-radial-gradient(center top, farthest-side, #cccccc 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-radial-gradient(center top, farthest-side, #cccccc 0%, rgba(255, 255, 255, 0) 100%);
background-image: radial-gradient(farthest-side at center top, #cccccc 0%, rgba(255, 255, 255, 0) 100%);
}Run Code Online (Sandbox Code Playgroud)
<hr>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
34230 次 |
| 最近记录: |