linear-gradients

Using JavaScript to edit CSS gradient

a 夏天 提交于 2019-11-26 08:26:11
问题 I am working on editing CSS gradients through JavaScript in Firefox. I have input boxes where the user can put 1. Orientation 2. 1st Color 3. 2nd Color Here is the html <html> <head> <title>Linear Gradient Control</title> <script> function renderButton(){ var orientation = document.getElementById(\"firstValue\").value; var colorOne = document.getElementById(\"firstColor\").value; var colorTwo = document.getElementById(\"secondColor\").value; //alert(orientation); //alert(colorOne); //alert

CSS3 cross browser linear gradient

大憨熊 提交于 2019-11-26 03:09:59
问题 What will be Opera and IE alternatives of following code? background-image: -webkit-gradient(linear, right top, left bottom, from(#0C93C0), to(#FFF)); background-image: -moz-linear-gradient(right, #0C93C0, #FFF); Note , I\'ve tested following rules. All browsers supports them. But they are vertical gradients. Can anyone help me to modify them to horizontal ones? background-image: -webkit-linear-gradient(top, #0C93C0, #FFF); background-image: -moz-linear-gradient(top, #0C93C0, #FFF);

How to remove the stripes that appears when using linear gradient property [duplicate]

余生长醉 提交于 2019-11-25 23:45:02
问题 This question already has answers here : Why does styling the background of the body element affect the entire screen? (7 answers) Closed last year . When using linear-gradient CSS property, the background appears without stripes when using left and right as direction value. But when direction value is given as top or bottom, stripes appears in the background. Is there any way that we can remove the stripes? Here is the code: body { background: linear-gradient(to top, red, yellow); } 回答1: You

Using percentage values with background-position on a linear gradient

爱⌒轻易说出口 提交于 2019-11-25 21:53:01
问题 Is there any way to make background-position take percentage values? Currently my button only works with an explicit values for width and background-position . body { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-around; align-items: center; } .button { display: flex; justify-content: center; align-items: center; text-decoration: none; color: white; font-weight: bold; width: 350px; height: 50px; border: 1px solid green; transition: background 0.5s;