The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Bug? background: linear-gradient
Without some text on the web page (h1, p ) The “linear-gradient” won’t apply
body { background: linear-gradient(-90deg,#2d5986,#538cc6); margin: 0px; padding: 0px; } “within an external css sheet”
by changing the margin (when there is no text) or padding to >0 the background will show, but it will mess up my fixed header.
In Chrome.
I have a hard time getting to know why this happens, maybe some one can clarify.
Without a demo of this not working it’s hard to understand what it is you are trying to do.
Oh, and why -90deg?
-90deg
Here is a demo: http://codepen.io/kvana/pen/beeXBe
It does seem weird… maybe chrome considers the height of the body to be 0, if there isn’t any content?
As a work-around you could give the body a min-height of 1 pixel maybe?
Happens in all desktop browsers as far as I can see… but no issues if you use html instead.
html