473,394 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

target="_new" is not strict xml1.0, how to do it in css?

Hi,

What's the property/value I need to set in css for A to mimic the
results of
<a href="..." target="_new">...</a>?

Cheers,

Paulo Matos

Jul 21 '05 #1
8 10876
po**@sat.inesc-id.pt wrote:
What's the property/value I need to set in css for A to mimic the
results of
<a href="..." target="_new">...</a>?
There isn't one in CSS up to version 2.1.
target="_new" is not strict xml1.0, how to do it in css?


target="_new" is wrong. See
http://www.w3.org/TR/html401/types.h...e-frame-target
Browsers will correct your error in one of three ways:
1. Ignore the target attribute
2. Treat it as target="new"
3. Treat it as target="_blank"
The difference between the last two will become apprarent if you have
multiple links with the same target attribute. In case (2) the same
window will be reused (so there are only every two windows) whilst in
case (3) a new window will be created for every link.

I guess that xml1.0 is a typo for XHTML 1.0?

This is NOT an HTML vs XHTML issue. The target attribute isn't in HTML
4 Strict either.

You have four options:
1. Don't open new windows, leave that up to the user
2. Use a Transitional version of HTML or XHTML instead
3. Use JavaScript instead
4. Don't worry about it not validating

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #2
po**@sat.inesc-id.pt wrote:
Hi,

What's the property/value I need to set in css for A to mimic the
results of
<a href="..." target="_new">...</a>?


Gee, an easy question. Answer: you don't. YOU may want a new window,
what make you think your visitor does?

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
Coordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
'94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
Jul 21 '05 #3
On Thu, 03 Mar 2005 17:49:37 -0300, Uncle Pirate <st**@surecann.com> wrote:
po**@sat.inesc-id.pt wrote:
Hi,
What's the property/value I need to set in css for A to mimic the
results of
<a href="..." target="_new">...</a>?


Gee, an easy question. Answer: you don't. YOU may want a new window,
what make you think your visitor does?


I agree with you, but when it comes to customers, sometimes they don't
understand and get mad. I remember one that called me furious and asked to
open most links of his new web site in a new window. I used a javascript
to simulate it.

<a href="http://google.com" onclick="window.open(this.href); return
false;">link</a>
--
Boost the visibility of your web site in Google!
http://www.digitalpoint.com/tools/ad-network/?s=5203

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #4
DU
Steve Pugh wrote:
po**@sat.inesc-id.pt wrote:

What's the property/value I need to set in css for A to mimic the
results of
<a href="..." target="_new">...</a>?

There isn't one in CSS up to version 2.1.

target="_new" is not strict xml1.0, how to do it in css?

target="_new" is wrong. See
http://www.w3.org/TR/html401/types.h...e-frame-target
Browsers will correct your error in one of three ways:
1. Ignore the target attribute
2. Treat it as target="new"
3. Treat it as target="_blank"


Non-Mozilla browsers will treat it as a new named window; Mozilla
browsers will treat it as a new unnamed window.

The difference between the last two will become apprarent if you have
multiple links with the same target attribute. In case (2) the same
window will be reused (so there are only every two windows) whilst in
case (3) a new window will be created for every link.

I guess that xml1.0 is a typo for XHTML 1.0?

This is NOT an HTML vs XHTML issue. The target attribute isn't in HTML
4 Strict either.

You have four options:
1. Don't open new windows, leave that up to the user
Best.
2. Use a Transitional version of HTML or XHTML instead
3. Use JavaScript instead
4. Don't worry about it not validating

Steve


DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.5 :)
Jul 21 '05 #5
DU
po**@sat.inesc-id.pt wrote:
Hi,

What's the property/value I need to set in css for A to mimic the
results of
<a href="..." target="_new">...</a>?

Cheers,

Paulo Matos

In a few years from now, the target property of the CSS3 hyperlink module
http://www.w3.org/TR/2004/WD-css3-hy...40224/#target0
may be implemented (if CSS3 Hyperlink module as it is right now is
approved).

<a href="..." style="target: new window above;">...</a>
or
<a href="..." style="target-name: new; target-new: window;
target-position: above;">...</a>

And even if and when such possibility happens, you can expect browser
manufacturers and Mozilla browsers (and other browsers based on/offering
tab-browsing) to give the user entire veto power and full control over
how links can open web pages. How to open a link should always be
entirely under the control and the power of the user.

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.5 :)
Jul 21 '05 #6
Unknown User wrote:
On Thu, 03 Mar 2005 17:49:37 -0300, Uncle Pirate <st**@surecann.com> wrote:
po**@sat.inesc-id.pt wrote:
Hi,
What's the property/value I need to set in css for A to mimic the
results of
<a href="..." target="_new">...</a>?

Gee, an easy question. Answer: you don't. YOU may want a new
window, what make you think your visitor does?


I agree with you, but when it comes to customers, sometimes they don't
understand and get mad. I remember one that called me furious and asked
to open most links of his new web site in a new window. I used a
javascript to simulate it.


I'm not sure what is meant by simulate it in this case. Either a window
opens or it doesn't? Using JavaScript is probably a good idea when
opening a window. I'd think (no research or figures, JMO) that those
leaving JavaScript enabled are less likely no be irritated by a new
window. In my experience, users that block popups and cookies, turn off
Java and JavScript, etc. do it all. Those that don't, do none of it.

As web developers/maintainers, we must do things that are against our
ideas/principles. For instance, something I feel rather strongly about
is file types; HTML for viewing, pdf for printing, application (Word,
Excel) for sharing editable files with others having the same
application. But, I have people putting up Word and Excel files for the
purpose of viewing that don't understand that we still have lots of
people on our own campus that still use Office 97 and cannot view the
Word XP files that they are linking in.

<a href="http://google.com" onclick="window.open(this.href); return
false;">link</a>


This does or doesn't open a new window? Is this what you are calling
"simulating" a new window?

I know this is off topic, but this response got me curious.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
Coordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
'94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
Jul 21 '05 #7
On Fri, 04 Mar 2005 13:12:04 -0300, Uncle Pirate <st**@surecann.com> wrote:
<a href="http://google.com" onclick="window.open(this.href); return
false;">link</a>


This does or doesn't open a new window? Is this what you are calling
"simulating" a new window?


Dear uncle, this snippet opens the link in a new tab/window, and is fully
complient with XHTML 1.0 Strict and 1.1.
--
Boost the visibility of your web site in Google!
http://www.digitalpoint.com/tools/ad-network/?s=5203

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #8
Unknown User wrote:
On Fri, 04 Mar 2005 13:12:04 -0300, Uncle Pirate <st**@surecann.com> wrote:
<a href="http://google.com" onclick="window.open(this.href);
return false;">link</a>

This does or doesn't open a new window? Is this what you are calling
"simulating" a new window?

Dear uncle, this snippet opens the link in a new tab/window, and is
fully complient with XHTML 1.0 Strict and 1.1.

That's what I thought it looked like. I'm just a bit confused by the
reference to "simulating" opening a window. Wondering what was meant by
that.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
Coordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
'94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
Jul 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob Evans | last post by:
Please excuse my ignorance on this matter.. but.... What exactly is the definition of a "pop-up window" - by that I mean one which will be blocked by software such as the Google Toolbar and...
3
by: Aaron | last post by:
Dim sbRegX As New StringBuilder(HttpUtility.HtmlEncode(txtComments.Text)) sbRegX.Replace("&lt;a&gt;", "<a>") sbRegX.Replace("&lt;/a&gt;", "") How do I get the attributes of href and target to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.