davidchildress — 2009-09-15T05:10:14-04:00 — #1
I have a list of links to college/university web sites... there are SO MANY links on the web page that I would like to add a "base" element to the document header specifying that all links will open by default in a new browser window/tab named "collegeWin".]
How would this be done?
davidchildress — 2009-09-15T06:36:34-04:00 — #2
I found the answer on page 109 of Elizabeth Castro's Visual Quickstart Guide; to wit...
<base target="winCollege" />
ralphm — 2009-09-15T22:23:52-04:00 — #3
Yeah, there's more info about this in the SitePoint reference section, in case you need it: http://reference.sitepoint.com/html/base
barb_rosholdt — 2014-09-11T15:57:18-04:00 — #4
Yeah, that's great but now there are a few targets that I DON'T want a new window, now that I got the base set. How do I deal with that? I'll keep looking.
barb_rosholdt — 2014-09-11T16:09:10-04:00 — #5
wow, that was quick! I found the answer! It is from Sitepoint Web Foundations (of all places)
=> target (HTML attribute)
"self" loads content in the same frame (This attribute isn’t normally required, as this is the default behavior unless the baseelement specifies otherwise. In that case, you’d need to override the specification using "self"; for example, .)
<p>You can try our <a href="cakes.html" target="_self">lovely range of cakes</a>.</p>
felgall — 2014-09-11T18:23:24-04:00 — #6
Note that the target attribute was flagged as obsolete back in 1997. Since then you are supposed to let your visitors choose where they want links to open. Without target they get at least three different choices. With target you effectively remove one of their choices if they don't know how to put it back.
Some people also configure their browser so that certain types of link open by default the way they want regardless of any obsolete target attributes the page may use. For example I don't like new tabs or windows being opened by web pages so I have my browsewr set to always open links in the current tab (except when I right click and choose differently).
pepster — 2014-09-12T13:12:33-04:00 — #7
FYI - In HTML5 the target attribute is no longer deprecated a - hyperlink
felgall — 2014-09-12T17:36:40-04:00 — #8
The reason for removing it still exists though - all it does is remove choices from those web users who don't know how to override it.
Anyway HTML 5 isn't a finished standard yet. There is still time for them to review the reasons for making tags and attributes obsolete back in 1997 and to reapply them to HTML 5 before it becomes a standard except in the rater case where the reason no longer applies.
The browser owner should be allowed to decide where they want links to open and you will lose visitors if you use that attribute and your visitor doesn't know how to override it so it all depends if you want to keep people on your site or not.