Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2012, 06:03 PM   PM User | #1
kayiro
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kayiro is an unknown quantity at this point
How can i let this code open in a new page?

Sow i know how to at
Code:
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 but always worked with wyiwyg stuff so coding is a bit new for me

I need this code to open in a new page
Code:
<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>
kayiro is offline   Reply With Quote
Old 11-29-2012, 06:33 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,224
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
http://www.w3schools.com/html/html_links.asp
Code:
<a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 11-29-2012, 06:36 PM   PM User | #3
kayiro
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kayiro is an unknown quantity at this point
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
kayiro is offline   Reply With Quote
Old 11-29-2012, 08:54 PM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 11-29-2012, 09:27 PM   PM User | #5
kayiro
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kayiro is an unknown quantity at this point
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
kayiro is offline   Reply With Quote
Old 11-30-2012, 12:00 AM   PM User | #6
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,224
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
Originally Posted by felgall View Post
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
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 11-30-2012, 12:02 AM   PM User | #7
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,224
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
Originally Posted by kayiro View Post
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?

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>
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.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!

Last edited by Spookster; 11-30-2012 at 12:06 AM..
Spookster is offline   Reply With Quote
Old 11-30-2012, 12:13 AM   PM User | #8
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Quote:
Originally Posted by kayiro View Post
[…] 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?

Quote:
Originally Posted by Spookster View Post
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.

All Hail Spookster!!
__________________
Don’t click this link!

Last edited by Spookster; 11-30-2012 at 12:24 AM..
VIPStephan is offline   Reply With Quote
Old 11-30-2012, 12:34 AM   PM User | #9
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,224
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
Originally Posted by VIPStephan View Post
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.

All Hail Spookster!!
Problem solved!
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 11-30-2012, 12:40 AM   PM User | #10
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
You are some kind of jester.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 11-30-2012, 07:05 AM   PM User | #11
sugisha
New to the CF scene

 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
sugisha is an unknown quantity at this point
Hi,

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>
sugisha is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:41 PM.


Advertisement
Log in to turn off these ads.