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

4271 questions
1397
votes
20 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
  • 16,033
  • 9
  • 27
  • 29
498
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
  • 56,088
  • 93
  • 276
  • 422
349
votes
21 answers

How to do gradient borders in CSS

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
  • 32,293
  • 33
  • 107
  • 137
303
votes
10 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,788
  • 12
  • 39
  • 49
293
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
  • 8,038
  • 3
  • 21
  • 22
290
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
  • 33,710
  • 23
  • 62
  • 78
275
votes
20 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
  • 13,357
  • 19
  • 80
  • 120
221
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,607
  • 12
  • 42
  • 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
181
votes
6 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
  • 20,756
  • 32
  • 99
  • 177
151
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,227
  • 4
  • 22
  • 24
145
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
  • 11,617
  • 18
  • 61
  • 74
139
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
  • 4,161
  • 7
  • 36
  • 73
132
votes
5 answers

Gradient of n colors ranging from color 1 and color 2

I often work with ggplot2 that makes gradients nice (click here for an example). I have a need to work in base and I think scales can be used there to create color gradients as well but I'm severely off the mark on how. The basic goal is generate…
Tyler Rinker
  • 108,132
  • 65
  • 322
  • 519
126
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
  • 14,361
  • 13
  • 70
  • 104
1
2 3
99 100