Tuesday, March 30, 2010

Opens link to a new tab

The other day, I was browsing Ceera's blog to see whether she's answered my request, but still to no avail. Hahahaa. Nevermind.

But what happen instead was, I chipped in and answered one of the questions on behalf of her. Don't know whether it was considered rude or what, but I did see there was one other person (in the comments) who did the same. So I follow suit. :D

Anyway, Ceera's comments was under moderation and my comment was approve, so i think i'm okay.. :P

Okay.. so the question was.. "How do we click a link and it automatically opens to a new tab".

Ceera taught the err.. not so practical way of opening a tab, which is by pressing on Ctrl and clicking the link at the same time. I guess this is the way if u were to surf on other people's blog/websites, since u have no control on their links, u can do that instead. The other method u can do is.. by right clicking the link, and choose 'open link in new tab'. both are quite the same. I prefer right clicking.

Google Chrome, shortcut keys..
Ctrl + N = open new blank window
Ctrl + T = open new blank tab


But how about if u want to implement a code on ur own blog that will automatically open ur link to a new tab just by one click; no need to press any Ctrl keys or right clicking. okay this was the one i chipped in..

1. in ur browser, there'll be an setting for u to choose whether you prefer to open in a new tab, a new window, the same tab or the same window. so pls set that 1st.. in this case, we are focusing on 'open in new tab', since everybody prefers tab. :P
update: for #1, u can skip this, coz some browser has already set all links to be open in tabs. the question is, the same tab or new tab? that is what we'll learn below. :P

2. now, in ur blog entry, key in ur link as usual but u have to add 1 tiny bit of code near the end.

here's the usual link that u use..
try and click this LINK#1, and see what happens. it will open in the same tab, rite?

now try key-ing target="_blank" in the code.

click this LINK#2, and see what happens. it automatically open in a new tab. :D

okay.. case closed!


u might be seeing more tutorials in this blog. it has been awhile. btw, this is my field, i do know HTML. so if u guys have any question or request for tutorials, pls feel free to do so. You can ask questions in my formspring.

Labels: ,


blog comments powered by Disqus

Older Posts    Home    Newer Posts
Related Posts Plugin for WordPress, Blogger...