radial-gradients

Gradient Radius as percentage of screen size

回眸只為那壹抹淺笑 提交于 2019-12-17 18:01:15
问题 I'm trying to create a shape drawable with radial gradient background, with radius that will adjust to the screen size (take a look at the relevant documentation). This is my code: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:endColor="#000" android:gradientRadius="50%p" android:startColor="#5d2456" android:type="radial" /> </shape> But it doens't seem to work. if I remove the "%p", it

Make <body> fill entire screen?

馋奶兔 提交于 2019-12-17 06:25:13
问题 I'm using a radial gradient as the background on my webpage, like so: background-image: -webkit-gradient(radial, 100% 100%, 10, 90% 90%, 600, from(#ccc), to(#000)); It works, but when the content does not fill the whole page the gradient is cut off. How can I make the <body> element fill the entire page, always? 回答1: html, body { margin: 0; height: 100%; } 回答2: On our site we have pages where the content is static, and pages where it is loaded in with AJAX. On one page (a search page), there

radial-gradient not working in firefox

只谈情不闲聊 提交于 2019-12-12 03:45:25
问题 This does not work in Firefox 22: background-image: -moz-radial-gradient(48% -42%, 138px 138px, green 0%, lightblue 100%); But it works in Chrome: background-image: -webkit-radial-gradient(48% -42%, 138px 138px, green 0%, lightblue 100%); It's the second argument Firefox has a problem with. If changed to background-image: -moz-radial-gradient(center, ellipse cover, #008000 0%, #add8e6 100%); /* FF3.6+ */ it works in FF, but that was not really the effect I'm after! jsbin with example 回答1: I

rounded shadow CSS

南笙酒味 提交于 2019-12-11 09:17:27
问题 I found the following : https://www.prowebdesign.ro/round-brush-like-responsive-drop-shadows-with-css3-and-no-images/ which seems amazing : full css and dynamic radial shadows! great. only I can't reproduce on consecutive items : .body{ background: white; } .bother{ width: 500px; background: lightgre; margin-left:50px; } .item{ margin-top: 20px; margin-left:50px; background: grey; width: 500px; position: relative; } .item:after{ content: ""; position: absolute; z-index: -1; box-shadow: 0 0

Radial gradient shows some backlines, gap, spaces or margins

筅森魡賤 提交于 2019-12-11 08:49:27
问题 I am new with radial-gradient and I don't know what are those back lines or spaces between the cubes? How to remove them? * {margin: 0; outline: 0; border: 0;} .round { background: radial-gradient(circle at 0 100%, rgba(204, 0, 0, 0) 70%, #c00 71%), radial-gradient(circle at 100% 100%, rgba(204, 0, 0, 0) 70%, #c00 71%), radial-gradient(circle at 100% 0, rgba(204, 0, 0, 0) 70%, #c00 71%), radial-gradient(circle at 0 0, rgba(204, 0, 0, 0) 70%, #c00 71%); background-position: bottom left, bottom

How to preallocate RadialGradient?

岁酱吖の 提交于 2019-12-11 08:17:33
问题 I'm drawing some circles on a canvas. I want to apply a radial gradient to each of this circle. I'm currently allocating a new gradient for each circle, but i'm guessing this not a very good idea. protected void onDraw(Canvas canvas) { int radius = 6; int cx = radius; int cy = radius ; for(int i = 0; i < nbPage; i++) { if(i % 12 == 0 && i > 0) { cx = radius; cy += 20; } RadialGradient gradient = new RadialGradient(cx, cy, radius, 0xFFFFFFFF, 0xFF000000, android.graphics.Shader.TileMode.CLAMP)

Making a dotted grid with CSS

…衆ロ難τιáo~ 提交于 2019-12-11 01:05:25
问题 I want the whole body to have a dotted grid body { background-image: radial-gradient(black 1px, transparent 0); background-size: 40px 40px; } The problem is that I want to shift it so that a dot is placed at the point (0, 0), i.e. the top left corner of the body . So the whole structure should be shifted at -20px, -20px . Or probably there is a better solution? 回答1: Update The following solution works, but only for a fixed background-size . See @Temani Afif's answer for a better solution.

Pure CSS gradient circle border

我们两清 提交于 2019-12-10 12:55:35
问题 I have this UI requirement At the moment, I have a working solution of a div (with a fixed height and width and a background image for the outer gradient border) and a pseudo element, positioned absolute with a background image of the inner border. .div { position: relative; width: 254px; height: 254px; border: 2px solid transparent; border-radius: 50%; background: url(../img/gradient_border_circle.png) no-repeat 50%; } div:before { content: ""; position: absolute; top: 50%; transform:

createRadialGradient and transparency

泪湿孤枕 提交于 2019-12-10 04:30:28
问题 I'm playing around with createRadialGradient() on HTML5 canvas. It works like a charm, except when I'm trying to implement (semi-)transparency. I made this jsFiddle to make things hopefully clearer: http://jsfiddle.net/rfLf6/1/. function circle(x, y, r, c) { ctx.beginPath(); var rad = ctx.createRadialGradient(x, y, 1, x, y, r); rad.addColorStop(0, c); rad.addColorStop(1, 'transparent'); ctx.fillStyle = rad; ctx.arc(x, y, r, 0, Math.PI*2, false); ctx.fill(); } ctx.fillRect(0, 0, 256, 256);

How to animate a radial-gradient using CSS?

半城伤御伤魂 提交于 2019-12-09 15:29:15
问题 I am trying to create a radial-gradient shine affect to a div box and I am unsure whats the best way of doing so. I Have found no resources of achieving what I want to achieve; just shine affects which look like overlay. Most of the examples I have found looks like this http://jsfiddle.net/nqQc7/512/. Below I have displayed what I am trying to create. #shine-div { height: 30vh; width: 60vw; margin-right: auto; margin-left: auto; border-radius: 10px; /*background: radial-gradient(ellipse