Help me with css gradient design

Discussion in 'Programming' started by Lifeonblack, Jun 28, 2018.

  1. Hello so I am setting my bacground with css gradient design
    I copied a css in https://webgradients.com but unfortunately don't know how to set it up.

    here's what I got in my clipboard
    Code (HTML5):
    background-image: linear-gradient(to top, #30cfd0 0%, #330867 100%);
    here's what I did
    Code (HTML5):
    div {
     background-image: linear-gradient(to top, #30cfd0 0%, #330867 100%);
    }
     
  2. you are using <div> tags I presume?
     
  3. Hmm not sure if that's a yes
    Code (HTML5):
    <style>
    div {
     background-image: linear-gradient(to top, #30cfd0 0%, #330867 100%);
    }
    </style>
     
  4. do you want the whole background to be that? if so, add to your CSS:
    Code (CSS):
    body {
        background-image: linear-gradient(to top, #30cfd0 0%, #330867 100%);
    }
    and then when you just do <body /> tag it will be said background.

    if you only want it to be in a certain section, add to your css:
    Code (CSS):
    #gradient {
        background-image: linear-gradient(to top, #30cfd0 0%, #330867 100%);
    }
    and do
    Code (HTML5):
    <div id="gradient" />
    in your html.

    by the looks of your replies you seem to just be blindly copying code from the internet, and that you have no real understanding of HTML and or CSS. please take the time to actually learn the language before posting simple mistakes online.
     
    • Agree Agree x 1