How to make a gradiant cover the whole page?

Discussion in 'HTML & Website Design' started by jake hazelwood, Aug 10, 2013.

  1. #1
    I have a gradiant in a css file and have linked to it on one of my pages and it works fine but it only covers around anything i put into the html and doesn't cover the whole page. Its almost like i need a empty element that covers the whole page so that the gradiant can fill it in

    here is the css rule ....
    .gradiant{
    width: 100%;
    height: 100%;
    background: #1e5799; /* Old browsers */
    background: #1e5799; /* Old browsers */
    background: -moz-linear-gradient(top, #1e5799 0%, #7db9e8 48%, #7db9e8 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(48%,#7db9e8), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #1e5799 0%,#7db9e8 48%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #1e5799 0%,#7db9e8 48%,#7db9e8 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, #1e5799 0%,#7db9e8 48%,#7db9e8 100%); /* IE10+ */
    background: linear-gradient(to bottom, #1e5799 0%,#7db9e8 48%,#7db9e8 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 );} /* IE6-9 */
     
    jake hazelwood, Aug 10, 2013 IP
  2. Tim Gallant Creative

    Tim Gallant Creative Member

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    You don't write what you are applying this CSS to.

    Try this:

    html { min-height:100%; }
    body { min-height:100%; }

    Now add your gradient CSS to your body element as well.
     
    Tim Gallant Creative, Aug 13, 2013 IP