WordPress.org

Forums

[resolved] Can't get this image to link (5 posts)

  1. Will Taft
    Member
    Posted 8 years ago #

    I'm back with another question I can't get figured out.

    I am trying to put a linkable image in my sidebar. Using the img code below, the image displays fine in the sidebar. I can't make it a link, however. Below the image code is one of the things I tried, but I must be overlooking something basic?

    Thanks!

    ---------------------------
    <img src=
    'http://www.geocaching.com/stats/img.aspx?uid=86892647-4b41-4ade-81ff-cd52d7cfbc11'
    border='0'
    width='200'
    height='50'
    ---------------------------

  2. <a href="http://www.geocaching.com/stats/img.aspx?uid=86892647-4b41-4ade-81ff-cd52d7cfbc11"
  • Will Taft
    Member
    Posted 8 years ago #

    Well, I tried a few more times and got it to work using the code below. Does it look OK code wise?
    --------------------------------

    <img src=
    'http://www.geocaching.com/stats/img.aspx?uid=86892647-4b41-4ade-81ff-cd52d7cfbc11'
    border='0'
    width='200'
    height='50'

  • vkaryl
    Member
    Posted 8 years ago #

    As far as the code goes, it's fine since it works. You may have a width problem depending on how wide the container (your sidebar) actually is. You should remove the border="0" element from the html, and check your css file to see if this declaration exists:

    img, img a {
    border:none;
    }

    If it doesn't exist already, then just add it in near the top (just under the body declaration would be fine). That's the better (meaning more valid) way to set no borders on images and image links.

  • Will Taft
    Member
    Posted 8 years ago #

    OK - Thanks! On another note, what did I do to my 2nd post above to make this thread losse it's formating or width? Was it just pasting in the code snippet that had width='200' in it?

    I looked and:

    img, img a {
    border:none;
    }

    is not in my css file. However all image links in the theme I am revising use the border=0. So I am guessing that if I change the css file, I need to also change every other php file that links to an image and take out the border= Think the change is worth the effort? I noticed that even the Google rss button I grabbed from Google's site uses the border=0 so it is all over my theme.

  • vkaryl
    Member
    Posted 8 years ago #

    Well, I'm picky: I expect any theme I use to validate. It's a very individual choice though, so not changing them is as viable an option as changing them is.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.