linear-gradients

How can I correctly add a shadow and a gradient to my shape?

限于喜欢 提交于 2019-11-29 11:18:38
问题 I want to make the following design: I tried with :after and :before but it does not work. Here’s my current code: .design { background: #ea053a; display: inline-block; height: 155px; margin-left: 33px; margin-right: 40px; position: relative; width: 228px; } .design:before { border-top: 43px solid #ea053a; border-left: 50px solid transparent; border-right: 50px solid transparent; margin-right: 40px; content: ""; height: 0; left: 0; position: absolute; top: 55px; margin-top: 100px; width:

Is it better to use images or CSS to keep performance of a webpage or application as high as possible?

ぐ巨炮叔叔 提交于 2019-11-29 09:11:57
My project's creative designer and I have had some amicable disagreements as far as whether it is better to use slices of his comp or rely on the browser's rendering engine to create certain aspects of the user experience. One specific example is with a horizontal "bar" that runs the entire width of the widget. He created a really snazzy gradient that involves several stops of different colors and opacities, and he feels that the small size of the image is preferable or at least comparable to the added lines of CSS code needed to generate the gradient natively. We're already using CSS sprite

CSS3 White to Transparent Gradient

你。 提交于 2019-11-29 03:58:12
I'm using CSS3 and RGBA to create a white-to-transparent gradient: div { background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(255, 255, 255, 1)), to(rgba(0, 0, 0, 0))); background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -o-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: linear-gradient(left, rgba(255, 255, 255, 1),

Border Gradient with Border Radius

懵懂的女人 提交于 2019-11-29 02:39:54
I have the following CSS:- a.btn.white-grad { background: $lgrey; color: #313149 !important; border: 1px solid #000; border-image-source: linear-gradient(to right, #9c20aa, #fb3570); border-image-slice: 20; float: left; @include font-size(26); margin: 75px 0; } Adding border-radius: 5px doesn't seem to do anything, I figured it's because I'm using border gradient, is there a way for me to achieve the desired 5px border radius at all? You cannot use border-radius with gradient. Here is another idea where you can rely on multiple background and adjust the background-clip : .white-grad {

Linear gradient in Chrome and Safari browsers

こ雲淡風輕ζ 提交于 2019-11-29 02:33:07
问题 I am having trouble showing a linear gradient in Safari and Chrome. In Firefox it shows up fine. I am trying: background: -webkit-linear-gradient(center top , #9E9E9E, #454545) repeat scroll 0 0 transparent; background: -moz-linear-gradient(center top , #9E9E9E, #454545) repeat scroll 0 0 transparent; background: -ms-linear-gradient(center top , #9E9E9E, #454545) repeat scroll 0 0 transparent; background: -o-linear-gradient(center top , #9E9E9E, #454545) repeat scroll 0 0 transparent; Thanks

How to get color value from gradient by percentage with javascript?

本小妞迷上赌 提交于 2019-11-28 21:29:13
I have a fixed width div with gradient applied using css. I want to build slider based color picker based on this gradient. When i drag the slider i calculate the percentage position, and i want to get the hex or rgb color code based on this value. My idea was to create an array with the start/stop positions and colors defined, then find two values from this array based on the slider position, then somehow find the color between: this is where i can't move forward. Demo: http://jsfiddle.net/pdu8rpfv/ var gradient = [ [ 0, 'ff0000' ], [ 28, '008000' ], [ 72, '0000ff' ], [ 100, 'ff0000' ] ]; $(

Background with gradient responsive

て烟熏妆下的殇ゞ 提交于 2019-11-28 14:28:04
I have the following code: ( Fiddle ) body { background-color: red; } #grad1 { height: 100px; width: 100%; background: linear-gradient(521deg, rgba(138, 138, 138, 0) 50%, rgba(138, 138, 138, 0) 31.9%, #fff 0.1%, #fff 0%); } <div id="grad1"></div> I basically want the width to be responsive and the gradient's shape to be maintained even though the width changes. What I've tried: Set the width to 100% this doesn't work because its an empty div That's about it, I have no other ideas to be honest. I'd appreciate if someone could help. This is what I'm using it for: (the images are just an example

linear-gradient to transparent bug in latest safari?

走远了吗. 提交于 2019-11-28 12:40:51
I'm applying a basic linear-gradient like this: background-image: linear-gradient(to top, red, rgba(0,0,0,0)); this behaves as it's supposed to everywhere except in safari where the transparent is rendered as a blackish/greyish color: here's chrome (how it is supposed to be): and here's safari I've tried prefixing it with -webkit- , changing the rgba to rgba(0,0,0,0.001) but it never goes to solid transparent. is this a bug? is there a way to fix this? here's a fiddle https://jsfiddle.net/2Lrp3sv1/2/ This has to do with the way browsers render transparent . For most browsers, transparent ===

How to make background-image with linear-gradient work on IE 11?

﹥>﹥吖頭↗ 提交于 2019-11-28 11:56:16
Any idea how I can make background-image with linear-gradient to work on IE 11? The following code works fine on IE 10 but doesn't work on IE 11. background-image: url(IMAGE), -ms-linear-gradient(top, #ffffff, #BEE38F); I can make linear-gradient to work on IE 6-9, 11 using the following filter but background image is not displayed in this case. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#BEE38F',GradientType=0 ) I'm open to an ideas. Update: Here's the code I currently have. background-image: url(IMAGE), -webkit-gradient(linear, left top, left

Webkit linear gradient stops render incorrectly

半世苍凉 提交于 2019-11-28 11:11:44
I have come across a weird problem in webkit browsers (Chrome, Opera). Test case: http://sample.easwee.net/gradient-bug/ (check in Chrome or latest Opera) I have two columns wrapped by a container. I'm applying a CSS gradient to create backgrounds for this two columns. The color stop is set to 66% and columns have the same 66% width (using padding to offset the right column). It renders correctly in Firefox - both column layout and gradient stop point match, but in webkit based browsers the color stop is not matching the column width, although I've used 66% . HTML: <div class="special