Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Bug? background: linear-gradient

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #242983
    AlexBEM
    Participant

    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.

    #242984
    Paulie_D
    Member

    Without a demo of this not working it’s hard to understand what it is you are trying to do.

    Oh, and why -90deg?

    #242989
    bearhead
    Participant

    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?

    #242994
    Shikkediel
    Participant

    Happens in all desktop browsers as far as I can see… but no issues if you use html instead.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.