gradient

Setting linear gradient's starting and ending position in MSIE 9 and older

假如想象 提交于 2019-12-11 02:44:55
问题 I have this CSS background-image: linear-gradient(360deg,rgb(255,255,255) 25% ,rgb(241,123,25) 75%); with -moz, -o, -webkit, -ms (for IE10) prefixes. I need to get this behaviour for older IEs using MSIE's filter. I can do this filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#F17B19', gradientType='1'); But in previous case it behaves as background-image: linear-gradient(360deg,rgb(255,255,255),rgb(241,123,25)); or background-image: linear-gradient

How do you make a LESS mixin for gradients with a variable number of stops?

走远了吗. 提交于 2019-12-11 01:29:41
问题 All of the Less mixins I have found for gradients have only a fixed number of stops. The clash between less and css in the use f the comma makes variable stops impossible to do in the same way. Current mixin that I use for 2 way gradients .gradient (@origin: left, @step-1: @white, @step-2: @black, @fallback: @step-1){ background-color: @fallback; background: -webkit-linear-gradient(@origin, @step-1, @step-2) @fallback no-repeat; background: -moz-linear-gradient(@origin, @step-1, @step-2)

Creating a layer of gradient within an SVG path dynamically

血红的双手。 提交于 2019-12-10 23:59:42
问题 I am creating a dynamic path using my SVG. I now wish to add gradient to my path but I am stuck. The way I am trying, my gradient is coming along the path as shown in image 2 while I require it to be the kind in image 1. Current My gradient and stroke definitions are as follows : <defs> <linearGradient id = "grad1" spreadMethod="reflect"> <stop offset="0%" style="stop-color: lightcoral;" /> <stop offset="50%" style="stop-color: #ffffff;" /> <stop offset="100%" style="stop-color: lightcoral;"

CSS Gradients with little content: Fix has problem with Chrome

做~自己de王妃 提交于 2019-12-10 21:17:26
问题 I asked a question CSS Gradients with little content some time back I came up with a possible fix http://jsfiddle.net/aruUS/2/ html, body { min-height: 100% } body { background: -moz-linear-gradient(top, blue, red 200px); background: -webkit-gradient(linear, 0 0, 0 200px, from(blue), to(red)); } only the Firefox part works, it appears webkit only supports percentages for color stops? Anyway to make this work? 回答1: Simply remove the px from 200px . Pixel values are unitless in Webkit's

drawRect: speed and CGContextDrawRadialGradient (super slow?)

北城以北 提交于 2019-12-10 21:14:32
问题 I'm having problems with my UIView subclass' drawRect: function. I use CGContextDrawRadialGradient() in it, and it. When the user drags my UIView it struggled to keep up if I include the gradient. Using Time Profiler I see that literally > 98% of my time is spent in my subclass' drawRect : method. First: would using a static image of a gradient be faster? Second: is there any way to speed this up? Can I cache the gradient somehow? it doesn't change much but paths around it and intersecting it

How can I do text gradient in CSS without affecting background?

夙愿已清 提交于 2019-12-10 19:07:47
问题 I would like to use a text gradient on my headers (this type of effect, basically). Commonly, this is achieved using png alpha-transparent image over the text. My problem with this solution is that within the header box alpha transparency will also influence the background. So if, for example, I wanted to use a photo as a background of my headers it would look awful. Is there a way around this (at least in some browsers, for starters). 回答1: There isn't a way to do this with CSS3 - even the

Does CSS3 support using both an image and a gradient for the background of a single <div>?

南笙酒味 提交于 2019-12-10 16:39:23
问题 I know you can do multiple backgrounds on a single <div> in CSS3, but is it possible to mix an image-referencing background (i.e. url(...) ) with a gradient generating background (e.g. -moz-linear-gradient(...) )? If so, what is the syntax? If not, what is a best-practice to achieve the same result? Thanks. 回答1: You can! background: -moz-linear-gradient(-45deg, rgba(0,0,255,0), rgba(0,0,255,1)), url("image"); which can be seen live at http://software.hixie.ch/utilities/js/live-dom-viewer

HTML5 canvas overlay transparent gradients

断了今生、忘了曾经 提交于 2019-12-10 16:36:20
问题 I'm creating a color picker in HTML5 like the gradient below It consists of three elements: A solid red background color (must be changeable) A black – transparent gradient from bottom to top A white – transparent gradient from the left to right I have managed to create a single gradient and a single color, but I can't figure out how to overlay the solid color and two gradients together. How can I accomplish this? (I could provide my code but it's pretty generic and wouldn't be useful) 回答1:

CSS3 fading out text

被刻印的时光 ゝ 提交于 2019-12-10 16:05:13
问题 I've been trying to get my text to fade out. I've tried some codes I've found on the internet, but they seem to be only for block elements. How do I make it work? Here's what I'm trying to get: Oh, and I DON'T want Internet Explorer support. Best regards, MarioErmando 回答1: Never mind, I've found my own solution. blablablabla<span class="readmore">blablablabla</span> .readmore { -webkit-mask-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 40%); } Unfortunately, only

How to draw vertical gradient in iTextSharp?

 ̄綄美尐妖づ 提交于 2019-12-10 15:42:32
问题 I am trying to draw a vertical gradient at the bottom of an iTextSharp pdf document: PdfShading shading = PdfShading.SimpleAxial(pdfWriter, 0, document.PageSize.Height, document.PageSize.Width, 0, BaseColor.WHITE, BaseColor.GREEN); PdfShadingPattern pattern = new PdfShadingPattern(shading); pdfContentByte.SetShadingFill(pattern); pdfContentByte.Rectangle(0, 0, document.PageSize.Width, 70); pdfContentByte.Fill(); This creates a gradient at the exact position I want it to be created, but the