I'm using <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> (xhtml strict doctype) for a site I'm designing and when I validated it, I found that you cannot have target="" included else it's not valid.

It then went on to say that I should use CSS to do this.

I want to make one link open in a new window (have the same effect as target="_blank" ) using CSS.

Can anybody help?

Regards,
Martin

this page would seem to say yes:

http://www.w3.org/TR/css3-hyperlinks/

bear in mind, most browsers have only got css2; and that specification seems to relate to css3.

you can do it with javascript if your stuck..

Thanks Matt,

I'll try it....

Regards,
Martin

I'm using <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> (xhtml strict doctype) for a site I'm designing and when I validated it, I found that you cannot have target="" included else it's not valid.

It then went on to say that I should use CSS to do this.

I want to make one link open in a new window (have the same effect as target="_blank" ) using CSS.

Can anybody help?

Regards,
Martin

In the place of target, put...onclick="target='newwindow'".
Then it will pass strict validation.
Sincerely,
Dynamictc
dynamictc@cableone.net

In the place of target, put...onclick="target='newwindow'".
Then it will pass strict validation.
Sincerely,
Dynamictc
dynamictc@cableone.net

Thanks Dynamictc,

I tried that and it works great.

Thanks again,
Martin

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.