Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > css -- new window for hyperlinks

Reply
Thread Tools

css -- new window for hyperlinks

 
 
one.1more@gmail.com
Guest
Posts: n/a
 
      03-05-2007
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 { }

 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-05-2007
Scripsit http://www.velocityreviews.com/forums/(E-Mail 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/
 
Reply With Quote
 
 
 
 
one.1more@gmail.com
Guest
Posts: n/a
 
      03-05-2007
> 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?



On Mar 5, 4:48 pm, "Jukka K. Korpela" <(E-Mail Removed)> wrote:
> Scripsit (E-Mail 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/



 
Reply With Quote
 
Ed Seedhouse
Guest
Posts: n/a
 
      03-05-2007
On 5 Mar 2007 13:15:27 -0800, (E-Mail Removed) wrote:

>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.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      03-05-2007
(E-Mail Removed) wrote:
> 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...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      03-05-2007
(E-Mail Removed) wrote:

> 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!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
one.1more@gmail.com
Guest
Posts: n/a
 
      03-06-2007
>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>


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












On Mar 5, 6:28 pm, "Jonathan N. Little" <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > 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!
>
> --
> Take care,
>
> Jonathan
> -------------------
> LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com



 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-06-2007
Scripsit Jonathan N. Little:

> (E-Mail Removed) wrote:
>
>> 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.


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 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.

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

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      03-06-2007
Jukka K. Korpela wrote:
> Scripsit Jonathan N. Little:
>
>> (E-Mail Removed) wrote:
>>
>>> 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.

>
> 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.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      03-06-2007
On 5 Mar, 21:15, (E-Mail Removed) wrote:
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlinks NOT underlined in website using CSS dreamspinner3 Computer Support 1 03-12-2007 08:06 PM
Overriding default window.status/defaultStatus behaviour by hyperlinks Jason ASP .Net 1 02-10-2005 07:38 AM
Hyperlinks and window status Jason ASP .Net 0 02-09-2005 03:41 PM
css hyperlinks not working kiki ASP .Net 0 08-14-2004 05:10 PM
CSS hyperlinks and tables W. Paulisse HTML 5 01-28-2004 09:38 PM



Advertisments