...

View Full Version : How can i let this code open in a new page?



kayiro
11-29-2012, 06:03 PM
Sow i know how to at
target="_blank" normally but i got this code in wp and i tried to paste it in the code where i need it but it doesnt work.

Such a noob question :D but always worked with wyiwyg stuff so coding is a bit new for me

I need this code to open in a new page

<a href="https://www.facebook.com/lowikvandevelden"><img src="http://www.rebelshouse.nl/preview/wp-content/uploads/2012/11/1354210663_facebook1.png" alt="" title="FB" width="32" height="32" class="alignleft size-full wp-image-154" /></a>

Spookster
11-29-2012, 06:33 PM
http://www.w3schools.com/html/html_links.asp


<a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>

kayiro
11-29-2012, 06:36 PM
I know that code cause i used it already on a link like that but as you can see, the link i use now is quiete long and i tried to paste the taget blank on different spots in the code but it doesnt work. Everytime i click the image it opens on the same page

felgall
11-29-2012, 08:54 PM
Why are you trying to eliminate ways that your visitors can open the link. All browsers generally allow you to select from same tab, new tab or new window when you right click on a link and adding one of those long dead target thingies will at best stop them from being able to choose one of the three (or more) alternatives that they will ordinarily have.

Some browsers even allow you to predefine how different sorts of links will be opened (my browser is configured to open links within a site in the same tab and external links in a new tab) - depending on how the browser is set your target will either be ignored or will annoy your visitor by blocking their selected choice.

That's why target was deleted from HTML back in 1997.

kayiro
11-29-2012, 09:27 PM
I dont know if it is deleted but i do know it still is used and i want my link like that because most people dont have their browsers set to open everything in a new tab.

Look, i need to do this multiple times, what i want is when people clink the fb icon it goes in a new tab.

You can find my page here (http://www.rebelshouse.nl/preview/lain)

Spookster
11-30-2012, 12:00 AM
That's why target was deleted from HTML back in 1997.

No it wasn't. It's currently a part of HTML5

http://www.w3schools.com/tags/tag_a.asp

Spookster
11-30-2012, 12:02 AM
I know that code cause i used it already on a link like that but as you can see, the link i use now is quiete long and i tried to paste the taget blank on different spots in the code but it doesnt work. Everytime i click the image it opens on the same page

So this doesn't work?



<a href="https://www.facebook.com/lowikvandevelden" target="_blank"><img src="http://www.rebelshouse.nl/preview/wp-content/uploads/2012/11/1354210663_facebook1.png" alt="" title="FB" width="32" height="32" class="alignleft size-full wp-image-154" /></a>


I just checked your page and clicked on the image links where you have the target attribute and it does indeed work. Are you sure you were clicking on the right ones? You didn't apply the target attribute to all of them.

VIPStephan
11-30-2012, 12:13 AM
[…] i do know it still is used and i want my link like that because most people dont have their browsers set to open everything in a new tab.

Maybe that’s because they don’t want links to open in new tabs/windows, or rather, they expect links to open in the same window. Why would you wanna force your perception on them?


No it wasn't. It's currently a part of HTML5

Yes, it was. It was not part of (strict) HTML 4 and XHTML 1. It was only re-added to HTML 5 because HTML 5 is tag soup reloaded. That doesn’t mean it’s good practice to use it.

But let’s not start a debate on basic principles. felgall has made his point and I tend to agree with him, so whoever wants to follow does, and the other ones can go to hell. :D

All Hail Spookster!!

Spookster
11-30-2012, 12:34 AM
Yes, it was. It was not part of (strict) HTML 4 and XHTML 1. It was only re-added to HTML 5 because HTML 5 is tag soup reloaded. That doesn’t mean it’s good practice to use it.

But let’s not start a debate on basic principles. felgall has made his point and I tend to agree with him, so whoever wants to follow does, and the other ones can go to hell. :D

All Hail Spookster!!

Problem solved! :thumbsup:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

VIPStephan
11-30-2012, 12:40 AM
You are some kind of jester. ;)

sugisha
11-30-2012, 07:05 AM
Please try this code,


<a href="https://www.facebook.com/lowikvandevelden" target="_blank"><img src="http://www.rebelshouse.nl/preview/wp-content/uploads/2012/11/1354210663_facebook1.png" alt="" title="FB" width="32" height="32" class="alignleft size-full wp-image-154"></a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum