SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: button location

  1. #1
    SitePoint Zealot
    Join Date
    Apr 2012
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    button location

    I have some images that i'm going to make buttons. I'm not exactly clear on how I can put these buttons in locations I want. I don't really have any code yet so I don't have anything to post.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,619
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    It kind of depends what you want those "buttons" to do, but the easiest solution is to wrap <a></a> tags around the image:

    Code:
    <a href=""><img src="/images/button1.png" alt="Click me, baby!"></a>

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2012
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I put some x,y locations in there to specify an area on the page for it to be?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,619
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    Quote Originally Posted by shakmbakm View Post
    Can I put some x,y locations in there to specify an area on the page for it to be?
    Yes, although that's often not the best way to position something. If you want to take this route, give that link a class and set it to position: absolute. Then you can give it left:/ top: coordinates, or perhaps right: / bottom: settings. BUT, they key to this working is to give the element they are being positioned in relation to position: relative. (E.g. Say you wanted this link to appear in the top right corner of your wrapper element. Give the wrapper position: relative, and then set the link to position: absolute top: 0 right: 0 or something like that.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •