css -- new window for hyperlinks

O

one.1more

I have a 15 page website.
Every single page is linked to a external style sheet style.css. Now,
when ever i click i link in my website, it opens in the same window. i
want the hyperlinks to open in a new window. i know how to do it for a
single link (using target _blank) but i don't want to do it 100
times.
is there something i can do in the external style sheet? like adding
a:something { }
 
J

Jukka K. Korpela

Scripsit (e-mail address removed):
I have a 15 page website.

Would it be different if there were 42 pages?
Every single page is linked to a external style sheet style.css.

OK. Though it has nothing to do with your question.
Now,
when ever i click i link in my website, it opens in the same window.

Perhaps. It depends on the way you click. Among other things.
i want the hyperlinks to open in a new window.

Stop wanting that. Problem solved.
i know how to do it for a
single link (using target _blank)

Too bad (if your site has some meaningful content).
but i don't want to do it 100 times.
Fine.

is there something i can do in the external style sheet? like adding
a:something { }

Thank &Deity;, no.
 
O

one.1more

Thank &Deity;, no.
I was researching for a way and i actually found it
the solution is { target-new:window} ref:http://www.w3.org/TR/css3-
hyperlinks/#the-target-new
But it created a new problem
in the style.css, i have two styles #header and #content. all the
pages are divided into a div with header style and a div with content
style

After using the method. this is how my style looks ( i condensed it)
#header { font-size:18;}
#content{font-size:14;target-new:window;}
The problem: all the links in the header part of my pages open into
new windows too. i just want the content windows' hyperlinks to open
in new windows. how do i fix this?
 
E

Ed Seedhouse

I have a 15 page website.
Every single page is linked to a external style sheet style.css. Now,
when ever i click i link in my website, it opens in the same window. i
want the hyperlinks to open in a new window. i know how to do it for a
single link (using target _blank) but i don't want to do it 100
times.
is there something i can do in the external style sheet? like adding
a:something { }

Don't do it at all. It is an outdated practice that drives users away
from your site.
 
J

Jonathan N. Little

I have a 15 page website.
Every single page is linked to a external style sheet style.css. Now,
when ever i click i link in my website, it opens in the same window. i
want the hyperlinks to open in a new window. i know how to do it for a
single link (using target _blank) but i don't want to do it 100
times.
is there something i can do in the external style sheet? like adding
a:something { }

Let's put aside all the reasons why your links should not open in new
windows ans say CSS is for controlling the presentation not the
mechanics or the behavior of a web document (The only exception it can
think of where the technical distinction is blurred is with the
pseudo-classes :hover, :focus and :active) If you want to change
behavior universally like that, aside of hard-coding the attribute I
would say JavaScript would be the way...
 
J

Jonathan N. Little

I was researching for a way and i actually found it
the solution is { target-new:window} ref:http://www.w3.org/TR/css3-
hyperlinks/#the-target-new

That CSS3, IE still doesn't support all of CSS2.1 you're going to get
very spotty support for CSS3.
But it created a new problem
in the style.css, i have two styles #header and #content. all the
pages are divided into a div with header style and a div with content
style

After using the method. this is how my style looks ( i condensed it)
#header { font-size:18;} ^^^
#content{font-size:14;target-new:window;}
^^^
Invalid, 18 and 14[what]? Miles? Need units for most CSS value lengths.
The problem: all the links in the header part of my pages open into
new windows too. i just want the content windows' hyperlinks to open
in new windows. how do i fix this?
Who knows? We cannot see your markup...no URL!
 
O

one.1more

Who knows? We cannot see your markup...no URL!
here is css3.css
-----------------------------------------------------
body {
font-family:arial,helvetica,sans-serif;
font-size:12px;
}
#header {
border: 1px solid #bbb;
height: 80px;
padding: 10px;
font-size: 12px;
}
#content {
border: 1px solid #bbb;
height: 600px;
padding: 10px;
font-size: 14px;
target-new:window;

}
-------------------------------------------------------------------------------------
here is index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css3.css" rel="stylesheet" type="text/css" />

</head>

<body>
<div id="header">
<a href="http://google.com">link in header
</a>
</div>
<div id="content">
<a href="http://yahoo.com">Link in footer
</a>
</div>
</body>

</html>


--------------------------------------------------------------------------------------------------------------------------












I was researching for a way and i actually found it
the solution is { target-new:window} ref:http://www.w3.org/TR/css3-
hyperlinks/#the-target-new

That CSS3, IE still doesn't support all of CSS2.1 you're going to get
very spotty support for CSS3.
But it created a new problem
in the style.css, i have two styles #header and #content. all the
pages are divided into a div with header style and a div with content
style
After using the method. this is how my style looks ( i condensed it)
#header { font-size:18;}

^^^> #content{font-size:14;target-new:window;}

^^^
Invalid, 18 and 14[what]? Miles? Need units for most CSS value lengths.
The problem: all the links in the header part of my pages open into
new windows too. i just want the content windows' hyperlinks to open
in new windows. how do i fix this?

Who knows? We cannot see your markup...no URL!
 
J

Jukka K. Korpela

Scripsit Jonathan N. Little:
That CSS3, IE still doesn't support all of CSS2.1 you're going to get
very spotty support for CSS3.

There is no CSS 3 except as a collection of various drafts, some of them
obsolete, some of them obsolescent, and some of them possibly progressing to
recommendation status some day.

A few of the huge number of new properties proposed in CSS 3 drafts have
been experimentally implemented, usually with many restrictions, in some
browsers. Thank &Deity;, as I wrote, the target properties don't belong even
to this "experimentally implemented" set.
Who knows? We cannot see your markup...no URL!

Who cares? The poster (e-mail address removed) is either a troll or a clueless
newbie who has firmly decided to remain a clueless newbie, as judged from
the continued clueless posting style.
 
J

Jonathan N. Little

Jukka said:
Scripsit Jonathan N. Little:


There is no CSS 3 except as a collection of various drafts, some of them
obsolete, some of them obsolescent, and some of them possibly
progressing to recommendation status some day.

Totally agree, I debated whether or not to mention it to OP but figure
it would probably just confuse him more! Only a hand full of browsers
have 'tried' to support some of CSS3 proposal properties, but with it
all so tenuous I would tell developers it is a waste of time.

As to this 'target-new' property the OP is futzing about, I do not have
a browser that supports it, but then again if supported probably
overridden by browser settings. I have must set to open new windows into
a tab, the way *I* what it! But it is probably trying to convince the OP
this.
 
A

Andy Dingley

I have a 15 page website.
i want the hyperlinks to open in a new window.
is there something i can do in the external style sheet?

No.

If you really want this, then the easiest way is the simple way of
using a target attribute on each <a>. Just find a smart way of
applying this change. Now's a good day to learn about good editors and
"regular expressions" (try jEdit)


It's unpopular locally to do this, but if you _really_ want to, then
it's your site.
 
J

Jukka K. Korpela

Scripsit Andy Dingley:
- -
If you really want this, then the easiest way is the simple way of
using a target attribute on each <a>.

Actually, there's a faster way of doing the damage: <base target="_blank">.
 
Joined
Mar 24, 2007
Messages
4
Reaction score
0
opening a new window

Jukka K. Korpela said:
Scripsit Andy Dingley:

>> i want the hyperlinks to open in a new window.

- -
> If you really want this, then the easiest way is the simple way of
> using a target attribute on each <a>.


Actually, there's a faster way of doing the damage: <base target="_blank">.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Well, this script actually passes strict validation to open a new window: onclick="target='newwindow'">

Bobby Blake
{Dynamictc}
(e-mail address removed)
 
Joined
Mar 24, 2007
Messages
4
Reaction score
0
Jukka K. Korpela said:
Scripsit (e-mail address removed):

> I have a 15 page website.


Would it be different if there were 42 pages?

> Every single page is linked to a external style sheet style.css.


OK. Though it has nothing to do with your question.

> Now,
> when ever i click i link in my website, it opens in the same window.


Perhaps. It depends on the way you click. Among other things.

> i want the hyperlinks to open in a new window.


Stop wanting that. Problem solved.

> i know how to do it for a
> single link (using target _blank)


Too bad (if your site has some meaningful content).

> but i don't want to do it 100 times.


Fine.

> is there something i can do in the external style sheet? like adding
> a:something { }


Thank &Deity;, no.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

You may have to do a lot of copy and paste, but at least it will pass strict validation. I made this script that you can use:

<a href="...your link..." onclick="target='newwindow'"></a>

of course you will have to change the quotes to meet your needs, but as long as the "onclick" is there, it should work.

Dynamictc
(e-mail address removed)
 
Joined
Mar 24, 2007
Messages
4
Reaction score
0
I have a 15 page website.
Every single page is linked to a external style sheet style.css. Now,
when ever i click i link in my website, it opens in the same window. i
want the hyperlinks to open in a new window. i know how to do it for a
single link (using target _blank) but i don't want to do it 100
times.
is there something i can do in the external style sheet? like adding
a:something { }


I know everyone has told you there is no way to put an "Open New Window" link in your style sheet for all of your links but there is. It has worked for me so I will help anyone interested. But I won't post it here. Since no one else has it, I am going to hold onto it. If you are still interested after this insert, I will help you out. You can email me at (e-mail address removed) to get the code.

Bobby Blake
 
Joined
Mar 24, 2007
Messages
4
Reaction score
0
Dynamictc said:
I know everyone has told you there is no way to put an "Open New Window" link in your style sheet for all of your links but there is. It has worked for me so I will help anyone interested. But I won't post it here. Since no one else has it, I am going to hold onto it. If you are still interested after this insert, I will help you out. You can email me at (e-mail address removed) to get the code.

Bobby Blake
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top