Using "background-image" in footer template. (I did not know how to describe my problem)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Greenpk
    Member
    • Nov 2012
    • 78

    Using "background-image" in footer template. (I did not know how to describe my problem)

    Recently I added a back to top button on my website. (It is not my code, it is someone else who made this.)

    Anyways I just want to know something about the css styling of it, by using images to describe what is going on.
    [ATTACH=CONFIG]n4029694[/ATTACH]

    This is my button, removed the background color and tried to use background-image instead.
    I uploaded the image file to this directory: images/primus/sandy/buttons
    I tried to switch out the "background: #FFF;" with "background-image:url('forum/images/primus/sandy/buttons/top_button.png');"

    I am currently using html <style> tags with css, so I have no idea how to make the image appear inside the back to top button.

    Image is like 144px wide or something. I have tried to adjust the padding, but that doesn't work either.
    Last edited by Greenpk; Sun 20 Apr '14, 9:34pm.
  • Greenpk
    Member
    • Nov 2012
    • 78

    #2
    HTML Code:
    <script type='text/javascript'>$(function(){$(window).scroll(function(){if($(this).scrollTop()!=0){$('#bttop' ).fadeIn();}else{$('#bttop').fadeOut();}});$('#bttop').click(function(){$('body,html').ani mate({scrollTop:0},800);});});
    </script>
    <style>
    #bttop {
    border:2px solid #4adcff;
    border-radius: 15px;
    background: url('images/primus/buttons/top_button.png');
    text align:center;
    padding:0px;
    position:fixed;
    bottom:35px;
    right:-15px;
    cursor:pointer;
    display:none;
    color:#fff;
    font-size:15px;
    font-weight:900;
    }
    </style>
    that is the script being used to create the button.

    Comment

    Related Topics

    Collapse

    Working...