Help with HTML code please, Trying to get my social buttons to open in a new window or tab |
Help with HTML code please, Trying to get my social buttons to open in a new window or tab |
trishden |
Apr 16 2012, 11:03 AM
Post
#1
|
Group: Members Posts: 4 Joined: 16-April 12 Member No.: 16,922 |
Hi, I'm new to this blogging thing and just had a makeover from a knowledgable web designer. The problem is she set up my social buttons, (facebook, twitter, etc) and they leave my page when clicked on. I would like them to open in a new tab or window. This designer is so busy it take weeks for her to get back to me. I did some research and I think the code needs a target="blank" put somewhere in the code but I'm not sure where. The code is in my sidebar in a text widget and reads as follows:
<center><a href="https://twitter.com/#!/trishden"><img src="http://i939.photobucket.com/albums/ad232/jeags8/twitter1.png"></a> <a href="https://plus.google.com/117443292363485259367/posts"><img src="http://i939.photobucket.com/albums/ad232/jeags8/google1.png"></a> <a href="http://www.stumbleupon.com/stumbler/trishden"><img src="http://i939.photobucket.com/albums/ad232/jeags8/stumble_upon.png"></a> <a href="https://www.facebook.com/pages/A-Fixer-Upper/253768451372938?sk=wall"><img src="http://i939.photobucket.com/albums/ad232/jeags8/facebook_1.png"></a> <a href="http://feeds.feedburner.com/afixerupper/UiHg"><img src="http://i939.photobucket.com/albums/ad232/jeags8/rss1.png"></a> <a href="http://digg.com/trishden"><img src="http://i939.photobucket.com/albums/ad232/jeags8/digg1.png"></a> My site can be found here: http://afixerupper.com/ Thanks for anyone who has the time to help me. I really appreciate it! Gratefully, Trish |
pandy |
Apr 16 2012, 11:10 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
As with all attributes you put it in the start tag.
CODE <a href="http://example.com" target="_blank">Link text</a> Note that target can't be used with a Strict doctype since it's been deprecated for many years. It's kinda outdated, for many reasons. It's usually avoided nowadays so you may just want to leave things as they are. The user has every possibility to open pages in new windows anyway if they prefer, but it isn't as easy to stop new windows from opening if that is forced by the site. Open in same window = everyone can get it how they want it. Open in new window = some people will be unhappy and won't like what you are doing. |
trishden |
Apr 16 2012, 12:20 PM
Post
#3
|
Group: Members Posts: 4 Joined: 16-April 12 Member No.: 16,922 |
As with all attributes you put it in the start tag. CODE <a href="http://example.com" target="_blank">Link text</a> Note that target can't be used with a Strict doctype since it's been deprecated for many years. It's kinda outdated, for many reasons. It's usually avoided nowadays so you may just want to leave things as they are. The user has every possibility to open pages in new windows anyway if they prefer, but it isn't as easy to stop new windows from opening if that is forced by the site. Open in same window = everyone can get it how they want it. Open in new window = some people will be unhappy and won't like what you are doing. Thanks. I tried it and it didn't work, just screwed up the button. I put it here: <center><a href="https://twitter.com/#!/trishden"><img target="_blank">Link text</a> src="http://i939.photobucket.com/albums/ad232/jeags8/twitter1.png"></a> I should highlight that I know nothing about code. Thanks anyway! |
pandy |
Apr 16 2012, 01:37 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
You put it in the wrong start tag. It should be in the start tag for A, not for IMG.
QUOTE I should highlight that I know nothing about code. Thanks anyway! Just select the text and hit the button with the hash sign (#) in the menu above. |
trishden |
Apr 16 2012, 02:12 PM
Post
#5
|
Group: Members Posts: 4 Joined: 16-April 12 Member No.: 16,922 |
You put it in the wrong start tag. It should be in the start tag for A, not for IMG. QUOTE I should highlight that I know nothing about code. Thanks anyway! Just select the text and hit the button with the hash sign (#) in the menu above. Thanks Pandy for all your help and I appreciate your knowledge but you are talking to an html illiterate. I tried this code: <center><a href="https://twitter.com/#!/trishden" target="_blank">Link text</a><img src="http://i939.photobucket.com/albums/ad232/jeags8/twitter1.png"></a> and my twitter button was in-opperable and there was the words "Link text" visible on the site widget that did open my twitter in a new window. Oh well maybe I should just leave well enough alone. I just know it bugs me when I click on someone's fb or twitter and it leaves the page that I might not have been done with. I guess I came to the wrong help site. I need to find a site that helps the peeps that don't know anything. Thanks anyway This post has been edited by trishden: Apr 16 2012, 02:13 PM |
pandy |
Apr 16 2012, 03:12 PM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
No no. The words "link text" were just meant as a place holder and the image must be enclosed in the A tags.
Linking some text or an image is the same thing. The text, or the image, that's contained in A becomes a link. That is, what's between <a href="..."> and </a>. Same goes for all HTML elements, they affect what the contain, not what's outside them. |
trishden |
Apr 16 2012, 04:28 PM
Post
#7
|
Group: Members Posts: 4 Joined: 16-April 12 Member No.: 16,922 |
OMG, thanks Pandy, I finally got it and it works like a charm! I'm a happy blogger.
|
Darin McGrew |
Apr 16 2012, 04:36 PM
Post
#8
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Please see the FAQ entry Where can I learn about HTML?
|
Lo-Fi Version | Time is now: 28th March 2024 - 05:39 AM |