Search code examples
cssbackgroundbackground-imagebackground-position

How to set background-image position above the element?


I have an element (a button) that i want to have 2 background images. one is a gradient and i want the other to position above the button. How do i do that?

Is there some way i can add something simillar to margin-top: -20px; or something like that?


Solution

  • The solution is using :before psuedo

    for example:

      .box:before{
           content:url(icon_neutral.png);
           display:block;
           position:relative;
           top: -30px;
      }
    

    according to gagarine's solution found here: