![]() |
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 {so that the links between these tags: <div class="blanktarget"></div> open up in a new window. |
Why don't you just use TARGET="_blank" in your links like normal?
|
Quote:
|
some people really like to make things more difficult for themselves than they have to be...
|
Quote:
|
Quote:
|
no its a bit more complicated then this. If i could do it more simple id already done it.
|
Just add this below </head> ..
Quote:
|
Quote:
You should tell that to whoever wrote this: http://www.developertutorials.com/tu...311/page1.html :winkwink: |
It's not possible.
|
Quote:
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... |
Quote:
|
Quote:
http://www.developertutorials.com/tu...311/page1.html |
It's javascript.. but thats ok isn't it?
|
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. |
ok so no css...
Quote:
|
Quote:
|
Quote:
I was more or less looking for any kind of a solution |
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 :thumbsup
|
Quote:
I hope it works out for you :thumbsup Of course your surfers without javascript aren't going to like it :( |
Quote:
|
Quote:
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! |
^^ nice explanation, gonna try this tomorrow, thanks man :)
|
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. |
misterwalrus, just put that base target code in my blog and it works perfect, thanks!
|
Quote:
Best way of doing it :2 cents: |
Quote:
|
| All times are GMT -7. The time now is 06:23 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123