SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How do I get a photo centered from a link

    Is there a way to center a photo after clicking on a link.... as in <a href="images/blahblah.jpg"> etc.....
    They open but are always in the upper left portion of the window.

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    No, if you just mean a direct link to a standalone JPEG file then it is up to the browser to just render the image file. Of course if it were a link to another webpage containing an image you could position the embedded image on that new page, etc. Alternatively something like a "Lightbox effect" using JavaScript may centre position the image on the current page (overlay images on top of the current page) if that is what you had in mind.

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Firefox seems to do that now by default. But as Robert says, the easiest way to ensure this is to make the link a link to an actual page, o which the images is centered with your own code. You can then style the page any way you like—with fancy borders etc.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


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
  •