Jump to content

css should include target


voodoo
 Share

Recommended Posts

Like, say this:target:windowtarget:parenttarget:selftarget: frame nametarget:tabI think that would be perfect, so you could do something linka.external {target:window}or body {target:tab}or if you wanted every link in a frame to not open a new window...frame,iframe {target:self}Plus when IE 7 releases, all browsers with full support of css will also include tabs.Who agrees?

Link to comment
Share on other sites

BTW the target attribute has been depreciated in XHTML...I doubt they will bring it back just because you ask...you have to do this through JavaScript now!

But be careful of what type of JavaScript you're going to use. A lot of people rely on the window.open() JavaScript, but if a user has JS disabled in their browser than the link won't work at all.There are other JS methods that offer a type of "fallback" incase the user does have JS disabled :)
Link to comment
Share on other sites

But be careful of what type of JavaScript you're going to use.  A lot of people rely on the window.open() JavaScript, but if a user has JS disabled in their browser than the link won't work at all.There are other JS methods that offer a type of "fallback" incase the user does have JS disabled :)

if you do this it will still open if JS is disable, just not in a new window.
<a href="somePage.html" onclick="window.open(this.href);return false;">Open me</a>

Link to comment
Share on other sites

if you do this it will still open if JS is disable, just not in a new window.
<a href="somePage.html" onclick="window.open(this.href);return false;">Open me</a>

That's pretty cool, I've always been using this
<a href='somepage.html' onclick="this.target='_blank';return true;">Open Me</a>

Works the same way, it will still open if JS is disable, just not in a new window.

Link to comment
Share on other sites

  • 1 month later...
Actually, you're, sort of, in luck.CSS3 Target Properties :)

This is my first post so please excuse my naievity!I have a little experience of CSS and would like to know how I can implement the code on the link in my webpage to allow a link to pop-up without using the conventional "_target" command. Would someone be able to assist me with this? I've been able to use the JS one but I would like to use the CSS one:-* { target-new: tab ! important }a[target],area[target],form[target] { target: attr(target,string) } a[target=_blank],area[target=_blank],form[target=_blank] { target: new }But I'm not sure how to "code it" Thanks in advanceRiteon
Link to comment
Share on other sites

The link you see is CSS3 specification. None of the modern browsers supports it yet. This was shown to see what the (near?) future holds. For now, the way is JavaScript.

Link to comment
Share on other sites

It'll be nice to have a way to use targets again... I haven't used it in a long time, since i've used XHTMl 1.0 Strict. Although, more advanced users know to just middle click (FF & Opera users at least) for a new tab :)

Link to comment
Share on other sites

It'll be nice to have a way to use targets again... I haven't used it in a long time, since i've used XHTMl 1.0 Strict. Although, more advanced users know to just middle click (FF & Opera users at least) for a new tab :)

You have a middle-click mouse? :) Wow, haven't seen one of those in a while... Hmm.In Opera I know you can use Shift + Click to open in a new tab (really a new window though, but a new window in Opera is essentially a new tab). That will also work in IE, but will really open a new window. Not so cool in IE.But then the problem isn't whether or not it's fast to open it in a new window, but if you want the user to have to open it in a new window sort of.
Link to comment
Share on other sites

You have a middle-click mouse? :) Wow, haven't seen one of those in a while... Hmm.In Opera I know you can use Shift + Click to open in a new tab (really a new window though, but a new window in Opera is essentially a new tab). That will also work in IE, but will really open a new window. Not so cool in IE.But then the problem isn't whether or not it's fast to open it in a new window, but if you want the user to have to open it in a new window sort of.

put your finger on your mouse wheel and press down. :click:middle clicks are still around on modern computers... but if you're on thinktank (my IBM Thinkpad 600 circa 98ish), it's the blue button under the spacebar :)
Link to comment
Share on other sites

put your finger on your mouse wheel and press down. :click:middle clicks are still around on modern computers... but if you're on thinktank (my IBM Thinkpad 600 circa 98ish), it's the blue button under the spacebar :)

When I put my finger on my mouse wheel and press down (as I have done several times before thank you :)), I only get faster scrolling, not having to press any buttons and just moving the mouse. I get a picture over the mouse pointer that looks like a circle with an ^ and v arrow on it, and also < and > if there is sideways scrolling involved. Maybe it's a matter of mouse settings or something.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...