Questions tagged [gradient]

Specifies a range of position-dependent colors, usually used to fill a region.

Specifies a range of position-dependent colors, usually used to fill a region.

enter image description here

3824 questions
1309
votes
19 answers

How do I combine a background-image and CSS3 gradient on the same element?

How do I use CSS3 gradients for my background-color and then apply a background-image to apply some sort of light transparent texture?
Ronald
  • 15,065
  • 8
  • 25
  • 28
448
votes
13 answers

CSS3 gradient background set on body doesn't stretch but instead repeats?

ok say the content inside the totals 300px high. If I set the background of my using -webkit-gradient or -moz-linear-gradient Then I maximize my window (or just make it taller than 300px) the gradient will be exactly 300px tall (the…
JD Isaacks
  • 51,154
  • 89
  • 267
  • 413
290
votes
17 answers

Gradient borders

I'm trying to apply a gradient to a border, I thought it was as simple as doing this: border-color: -moz-linear-gradient(top, #555555, #111111); But this does not work. Does anyone know what is the correct way to do border gradients?
Mark
  • 28,819
  • 33
  • 102
  • 136
288
votes
7 answers

CSS3 Transparency + Gradient

RGBA is extremely fun, and so is -webkit-gradient, -moz-gradient, and uh... progid:DXImageTransform.Microsoft.gradient... yeah. :) Is there a way to combine the two, RGBA and gradients, so that there's gradient of alpha transparency using the…
Jourkey
  • 29,462
  • 23
  • 59
  • 78
268
votes
10 answers

Android LinearLayout Gradient Background

I am having trouble applying a gradient background to a LinearLayout. This should be relatively simple from what I have read but it just doesn't seem to work. For reference sakes I am developing on 2.1-update1. header_bg.xml:
Genesis
  • 7,478
  • 3
  • 18
  • 22
264
votes
9 answers

How to make gradient background in android

I want to create gradient background where the gradient is in the top half and there's a solid color in the bottom half, like in this image below: I can't because the centerColor spreads out to cover the bottom and top. How can I make a…
kongkea
  • 9,062
  • 11
  • 37
  • 47
227
votes
17 answers

Use CSS3 transitions with gradient backgrounds

I'm trying to transition on hover with css over a thumbnail so that on hover, the background gradient fades in. The transition isn't working, but if I simply change it to an rgba() value, it works fine. Are gradients not supported? I tried using an…
alt
  • 11,918
  • 17
  • 72
  • 115
220
votes
7 answers

Gradients on UIView and UILabels On iPhone

Possible Duplicate: Manually drawing a gradient in iPhone apps? My application needs to display text in either a UIView or UILabel but the back ground must be a gradient as opposed to a true UIColor. Using a graphics program to create desired…
TonyNeallon
  • 6,557
  • 12
  • 40
  • 49
191
votes
17 answers

IE9 border-radius and background gradient bleeding

IE9 is apparently able to handle rounded corners by using the CSS3 standard definition of border-radius. What about support for border radius and background gradient? Yes IE9 is to support them both separately, but if you mix the two the gradient…
SigmaBetaTooth
  • 2,084
  • 2
  • 13
  • 8
179
votes
5 answers

Multi-gradient shapes

I'd like to create a shape that's like the following image: Notice the top half gradients from color 1 to color 2, but theres a bottom half that gradients from color 3 to color 4. I know how to make a shape with a single gradient, but I'm not sure…
Andrew
  • 19,726
  • 30
  • 93
  • 171
148
votes
19 answers

Get Slightly Lighter and Darker Color from UIColor

I was looking to be able to turn any UIColor into a gradient. The way I am intending to do this is by using Core Graphics to draw a gradient. What I am trying to do is to get a color, lets say: [UIColor colorWithRed:0.5 green:0.5 blue:0.5…
CoreCode
  • 2,177
  • 4
  • 18
  • 24
122
votes
4 answers

Pytorch, what are the gradient arguments

I am reading through the documentation of PyTorch and found an example where they write gradients = torch.FloatTensor([0.1, 1.0, 0.0001]) y.backward(gradients) print(x.grad) where x was an initial variable, from which y was constructed (a…
Qubix
  • 3,372
  • 7
  • 21
  • 54
121
votes
6 answers

SVG gradient using CSS

I'm trying to get a gradient applied to an SVG rect element. Currently, I'm using the fill attribute. In my CSS file: rect { cursor: pointer; shape-rendering: crispEdges; fill: #a71a2e; } And the rect element has the correct fill color…
Hrishikesh Choudhari
  • 9,809
  • 17
  • 58
  • 73
115
votes
8 answers

Circular gradient in android

I'm trying to make a gradient that emits from the middle of the screen in white, and turns to black as it moves toward the edges of the screen. As I make a "normal" gradient like this, I have been experimenting with different shapes:
pgsandstrom
  • 13,733
  • 12
  • 68
  • 102
111
votes
10 answers

Gradients in Internet Explorer 9

Does anyone know the vendor prefix for gradients within IE9 or are we still supposed to still be using their proprietry filters? What I've got for the other browsers is: background-image: -moz-linear-gradient(top, #444444, #999999); /* FF3.6…
Sniffer
  • 5,950
  • 8
  • 41
  • 53
1
2 3
99 100