CSS: Linear vertical gradient in a box
Question by Compi | 2012-05-13 at 23:59
I want to place a gradient in a box with the help of CSS. The gradient should be linear and vertical, so, for example, it should run from white (top) to black (bottom).
Can anyone tell me how to do this? I have the problem that the gradient is not displayed correctly in all browsers.
Related Topics
CSS: Include CSS Stylesheets in HTML
Tutorial | 0 Comments
Website Performance: Deliver JavaScript and CSS files compressed to reduce loading times
Tutorial | 0 Comments
Total Lunar Eclipses in Germany - Dates
Info | 0 Comments
jQuery: CSS Stylesheet Switcher
Tutorial | 1 Comment
Reload Images, CSS, JS and Web Pages despite Browser Cache
Tip | 2 Comments
Darken Background of a Website (Gray Out Effect)
Tutorial | 0 Comments
O-Notation
Article | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Unfortunately, you do write what you have already tried. That your gradient is not visible in all browsers, however, can have several reasons.
We must be aware, that the browser supports the corresponding properties. The property "linear-gradient" in its pure form is understood only by browsers that are compatible with CSS3. For earlier versions, you need an appropriate prefix, so that the CSS is understood, very old browsers such as Internet Explorer 6 cannot understand and translate the rules at all.
You should use the following CSS rules:
First we see the CSS rules with a prefix for the browsers mentioned, then the CSS3 rule for all browsers supporting CSS3.
2012-05-14 at 19:21