目标= _blank或不要目标= _blank,这就是问题所在! [英] To target=_blank or not to target=_blank, that is the question!

查看:139
本文介绍了目标= _blank或不要目标= _blank,这就是问题所在!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应该链接到外部网站设置目标= _blank?例如。我在www.acme.net上有链接到www.otherplace.net,链接应该是:


< a href ='http:// www.otherplace.net'target ='_ blank'> otherplace的网站< / a>





< a href ='http:// www.otherplace.net '> otherplace的网站< / a>


我的印象是,使用_blank到域外的网站是最佳做法,但现在我被告知不然。

解决方案

一些网络理想主义者会说你应该允许用户做出他们自己的选择导航 - 我非常同情这种观点。作为网络开发者,我们不应该强迫我们的访问者作出这样的决定。

然而,我也知道企业通常希望保持控制,所以坚持产卵外部网站的新标签页/窗口。我也了解这一点 - 这是一种非常实用的方法,尤其是当您考虑有多少用户不知道如何控制自己的UA时。我常常倾向于通过添加图片(我相信您会在您的时间内看到很多内容),指明哪些链接是外部链接,并且 以指示外部链接将在新标签页/窗口中打开。


Should links to external sites set target=_blank? E.g. I am on www.acme.net and have a link to www.otherplace.net, should that link be:

<a href='http://www.otherplace.net' target='_blank'>otherplace's website</a>

or:

<a href='http://www.otherplace.net'>otherplace's website</a>

I was under the impression that using _blank to sites outside your domain was best practice, but now I am being told otherwise.

解决方案

Some web idealists will state that you should allow the user to make their own choices when it comes to navigation - I have a lot of sympathy with this view. As web developers, we shouldn't be forcing such decisions on our visitors.

However, I also know that businesses often want to 'retain control' and so insist on spawning a new tab/window for external sites. An I understand this too - It's a very practical approach, particularly when you consider that how many users don't know how to control their own UA.

I often tend to steer a middle course between the two, by adding an image (I'm sure you will have seen many in your time) that indicates which links are external, and a note to indicate that external links will open in a new tab/window.

Not quite as 'pure' as the first option, but at least it is clear to the user how the site will behave.

这篇关于目标= _blank或不要目标= _blank,这就是问题所在!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆