Responsive button

Discussion in 'HTML & Website Design' started by Rub3X, Nov 19, 2014.

  1. #1
    I've got a button on revolution slider with the following:

    <a id="homebutton" href="#" >&nbsp;</a>

    With the following CSS:

    #homebutton {
    position:fixed;
    width: 188px;
    height: 41px;
    text-indent: -19999px;
    background-image: url('http://***.com/wp-content/uploads/2014/11/button2.png');
    }
    #homebutton:hover{
      background-image: url('http://****.com/wp-content/uploads/2014/11/button2-2.png');
    
    }
    Code (markup):
    The button works perfect on a desktop, but on mobile it renders it huge and not where it's supposed to be. How can I position it so it is responsive with mobile browsers?
     
    Rub3X, Nov 19, 2014 IP
  2. Trapcode

    Trapcode Member

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #2
    I would recommend use of bootstrap buttons, They are awesome and responsive.
     
    Trapcode, Nov 20, 2014 IP
  3. Daniel.Thomas

    Daniel.Thomas Member

    Messages:
    107
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    25
    #3
    hey man. The issues is that your using fixed values for your width and height. Try using % instead of pixels. Or use font-size alongside padding. I can't suggest any values as I don't know how the button looks.
    Lose the fixed positioning and try relative instead. Good luck :)
     
    Daniel.Thomas, Nov 20, 2014 IP
  4. Rub3X

    Rub3X Well-Known Member

    Messages:
    1,902
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    135
    #4
    I changed position to relative and tried various percentages using width: 10%; width: 20%, but not only did nothing change based on the different % values, but even removing them all together nothing changed. It only shows a tiny portion of the button, the top left and not the whole thing. Any ideas? I could show you the site if that helps.
     
    Rub3X, Nov 20, 2014 IP
  5. MakingMoves

    MakingMoves Active Member

    Messages:
    51
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    50
    #5
    Put your code on codepen and put it back here...easier to see that way.
     
    MakingMoves, Nov 20, 2014 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Why are you pissing off users with something that big fixed on the display that sucks down screen space better used for content... if you're worrying about mobile why don't you just feed that different CSS in your media queries?

    Of course, if that's the jQuery-tard "revo slider" garbage, you've already pissed on the capability of being mobile friendly, so you're knee deep in it unless you want to throw the entire site away and start over. Mind you that's a wild guess with me pulling an assumption out of my backside, but just from what little you've said that's what I'm thinking.
     
    deathshadow, Nov 20, 2014 IP
  7. Rub3X

    Rub3X Well-Known Member

    Messages:
    1,902
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    135
    #7
    You feel better after that rant? I came here for help because I can't get the percentages to work, I know fixed is the problem. Revolution slider looks just fine on the mobile, aside from this button. If you could help me figure out how to properly size the button with relative position, that'd be great. If not, I really fail to see the point of your post.
     
    Rub3X, Nov 21, 2014 IP
  8. ketting00

    ketting00 Well-Known Member

    Messages:
    782
    Likes Received:
    28
    Best Answers:
    3
    Trophy Points:
    128
    #8
    ketting00, Nov 23, 2014 IP