Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-21-2005, 05:37 PM   #1
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
how do i let links open in a new window using css?

I wanna use a class in css to define that the links between that class's tags on the actual page open up in a new window.

Lets say i wanna call this class 'blanktarget', whats the code i gotta put in the style sheet file? U know something like this:
Code:
.blanktarget a {
    href:blank;
}
(^^^^ improvised code just for an example)

so that the links between these tags:
<div class="blanktarget"></div>
open up in a new window.
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:39 PM   #2
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
Why don't you just use TARGET="_blank" in your links like normal?
__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:44 PM   #3
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
Quote:
Originally Posted by kenny
Why don't you just use TARGET="_blank" in your links like normal?
its a hardlink trade list in my blog, but u add the links quickly thru an admin panel..i dont wanna get into the source too everytime i add a link.
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:44 PM   #4
Rorschach
So Fucking Banned
 
Join Date: Aug 2002
Posts: 5,579
some people really like to make things more difficult for themselves than they have to be...
Rorschach is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:45 PM   #5
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
Quote:
Originally Posted by Rorschach
some people really like to make things more difficult for themselves than they have to be...
like you ?
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:46 PM   #6
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
Quote:
Originally Posted by nico-t
its a hardlink trade list in my blog, but u add the links quickly thru an admin panel..i dont wanna get into the source too everytime i add a link.
Can't you edit the program?
__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:47 PM   #7
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
no its a bit more complicated then this. If i could do it more simple id already done it.
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:49 PM   #8
xlogger
Confirmed User
 
Join Date: Jul 2004
Location: NY
Posts: 9,507
Just add this below </head> ..

Quote:
<base target="_blank">
..and all the links will open in new window.
__________________

----------
XLOGGER [REFLECTED] [OH]
xlogger is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:52 PM   #9
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
Quote:
Originally Posted by xlogger
Just add this below </head> ..



..and all the links will open in new window.
There is some HTML that I never knew existed !

You should tell that to whoever wrote this:

http://www.developertutorials.com/tu...311/page1.html

__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:53 PM   #10
swedguy
Confirmed User
 
Industry Role:
Join Date: Jan 2002
Posts: 7,981
It's not possible.
swedguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:53 PM   #11
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
Quote:
Originally Posted by xlogger
Just add this below </head> ..



..and all the links will open in new window.
thanks, but i want just several "blocks" of links to open in a new window, not the whole page....
Its a wordpress blog, with several php files/templates etc thrown together when u visit the site, thats why the way i want it is, as far as i know, the only option really...
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:54 PM   #12
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
Quote:
Originally Posted by swedguy
It's not possible.
christ.... u know this 100% sure?
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:55 PM   #13
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
Quote:
Originally Posted by swedguy
It's not possible.
doesn't this code do it? Or am I reading this wrong?

http://www.developertutorials.com/tu...311/page1.html
__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 05:56 PM   #14
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
It's javascript.. but thats ok isn't it?
__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:02 PM   #15
Robertf
Confirmed User
 
Join Date: Feb 2004
Posts: 392
You can't do that in CSS ....

As suggested before .. or you let all open i na new window or you will have to add target=.. to the links you wanne open in a new window.
__________________
....
Robertf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:10 PM   #16
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
ok so no css...
Quote:
Originally Posted by kenny
doesn't this code do it? Or am I reading this wrong?

http://www.developertutorials.com/tu...311/page1.html
^^ this might actually work... the internal links, like the category links all open in the same window when i put my domain name in that piece of code.. so im gonna give this one a try! Thanks for the link
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:11 PM   #17
swedguy
Confirmed User
 
Industry Role:
Join Date: Jan 2002
Posts: 7,981
Quote:
Originally Posted by kenny
doesn't this code do it? Or am I reading this wrong?

http://www.developertutorials.com/tu...311/page1.html
Javascript is not the same thign as CSS.
swedguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:20 PM   #18
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
Quote:
Originally Posted by swedguy
Javascript is not the same thign as CSS.

I was more or less looking for any kind of a solution
__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:20 PM   #19
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
since css doesnt have this sort of code its a good substite, i just tested this javascript code, and it works perfectly! my blog is now exactly the way i want, thanks
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:21 PM   #20
kenny
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 7,245
Quote:
Originally Posted by nico-t
ok so no css...

^^ this might actually work... the internal links, like the category links all open in the same window when i put my domain name in that piece of code.. so im gonna give this one a try! Thanks for the link

I hope it works out for you

Of course your surfers without javascript aren't going to like it
__________________
7
kenny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:24 PM   #21
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
Quote:
Originally Posted by kenny
I hope it works out for you

Of course your surfers without javascript aren't going to like it
yeah ok, but who aint got javascript these days? i thought all the browsers got javascript, only not when u disable it yourself manually.... so i think this solution is fine
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:26 PM   #22
misterwalrus
Confirmed User
 
Join Date: Jan 2001
Location: Burbank, Ca
Posts: 270
Quote:
Originally Posted by nico-t
thanks, but i want just several "blocks" of links to open in a new window, not the whole page....
Its a wordpress blog, with several php files/templates etc thrown together when u visit the site, thats why the way i want it is, as far as i know, the only option really...
The <base target="_blank"> tag will work. Add it in to where it needs to be. On my wordpress blog, it is inserted in the index_sidebar.html and the post_sidebar.html. But then again, I don't mind going in and editing a couple lines of code to add a link so I can have my site act the way I want.
Sample:

<div id="menu">
<ul>
<li id="recentposts">Recent Posts
{recentposts mode="list"}
</li>

<li id="categories">Categories:
{sectionlinks mode="list" skip=10}
</li>
</ul>
<ul>
<li id="Links">Links
<ul>
Hand coded links to open in same window are below here!
then...
<base target="_blank">
<li id="Pornblog">Porn Blogs
<ul>
and hand coded links for links I want to open in new window go here!
__________________
Trades and Exchanges
Submit to XXX Blog Index Growing Daily
XXX Blog Maniac Hardlinks
Battlin Bitchs Hardlinks and Traffic Trades
XXX Blog Feeds
misterwalrus is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:29 PM   #23
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
^^ nice explanation, gonna try this tomorrow, thanks man
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2005, 06:34 PM   #24
Orange Sim
Registered User
 
Join Date: May 2005
Posts: 12
You can't do that in CSS.
You are mis-understanding what CSS is for and what it does.

Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Orange Sim is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2005, 04:52 AM   #25
nico-t
emperor of my world
 
Join Date: Aug 2004
Location: nethalands
Posts: 29,903
misterwalrus, just put that base target code in my blog and it works perfect, thanks!
nico-t is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2005, 05:46 AM   #26
SGS
Confirmed User
 
SGS's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Mallorca - Nottingham
Posts: 5,176
Quote:
Originally Posted by misterwalrus
The <base target="_blank"> tag will work. Add it in to where it needs to be. On my wordpress blog, it is inserted in the index_sidebar.html and the post_sidebar.html. But then again, I don't mind going in and editing a couple lines of code to add a link so I can have my site act the way I want.
Sample:

<div id="menu">
<ul>
<li id="recentposts">Recent Posts
{recentposts mode="list"}
</li>

<li id="categories">Categories:
{sectionlinks mode="list" skip=10}
</li>
</ul>
<ul>
<li id="Links">Links
<ul>
Hand coded links to open in same window are below here!
then...
<base target="_blank">
<li id="Pornblog">Porn Blogs
<ul>
and hand coded links for links I want to open in new window go here!

Best way of doing it
__________________
See sig...
SGS is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-22-2005, 03:02 PM   #27
misterwalrus
Confirmed User
 
Join Date: Jan 2001
Location: Burbank, Ca
Posts: 270
Quote:
Originally Posted by nico-t
misterwalrus, just put that base target code in my blog and it works perfect, thanks!
Glad to help!
__________________
Trades and Exchanges
Submit to XXX Blog Index Growing Daily
XXX Blog Maniac Hardlinks
Battlin Bitchs Hardlinks and Traffic Trades
XXX Blog Feeds
misterwalrus is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.