Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hyperlink
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==How hyperlinks work in HTML== A link from one domain to another is said to be ''outbound'' from its source anchor and [[inbound link|''inbound'']] to its target. The most common destination anchor is a [[Uniform Resource Locator|URL]] used in the [[World Wide Web]]. This can refer to a document, e.g. a [[webpage]], or other resource, or to a position in a webpage. The latter is achieved by means of an [[HTML element]] with a "name" or "id" attribute at that position of the HTML document. The URL of the position is the URL of the webpage with a [[fragment identifier]]{{snd}} "#''id attribute''"{{snd}} appended. When linking to PDF documents from an HTML page the "''id attribute''" can be replaced with syntax that references a page number or another element of the PDF, for example, "#''page=386''". ===Link behavior in web browsers=== {{anchor|Link decoration}}A [[web browser]] usually displays a hyperlink in some distinguishing way, e.g. in a different [[color]], [[font]] or [[Typeface|style]], or with certain symbols following to visualize link target or document types. This is also called ''link decoration''. The behavior and style of links can be specified using the [[Cascading Style Sheets]] (CSS) language. In a graphical user interface, the appearance of a mouse [[Cursor (user interface)|cursor]] may change into a [[hand]] motif to indicate a link. In most graphical web browsers, links are displayed in underlined blue text when they have not been visited, but underlined purple text when they have. When the [[user (computing)|user]] activates the link (e.g., by clicking on it with the [[Computer mouse|mouse]]) the browser displays the link's target. If the target is not an HTML file, depending on the [[file type]] and on the browser and its [[Plug-in (computing)|plugins]], another program may be activated to open the file. The HTML code contains some or all of the five main characteristics of a link: * '''link destination''' ("href" pointing to a URL) * '''[[Anchor text|link label]]''' * '''link title''' * '''link target''' * '''link class''' or '''link id''' It uses the [[HTML anchor|HTML element "a"]] with the attribute "href" (HREF is an abbreviation for "Hypertext REFerence"<ref>{{cite web|author=Tim Berners-Lee|url=https://www.w3.org/Provider/ServerWriter.html|title=Making a Server ("HREF" is for "hypertext reference")|publisher=W3C|access-date=2012-10-25|url-status=live|archive-url=https://web.archive.org/web/20121025220948/http://www.w3.org/Provider/ServerWriter.html|archive-date=2012-10-25|author-link=Tim Berners-Lee}}</ref>) and optionally also the attributes "title", "target", and "[[Cascading Style Sheets|class]]" or "id": :<samp><a href="''URL''" title="''link title''" target="''link target''" class="''link class''">''link label''</a></samp> To embed a link into a web page, blogpost, or comment, it may take this form: :<code><nowiki><a href="https://example.com/">Example</a></nowiki></code> In a typical web browser, this would display as the underlined word "Example" in blue, which when clicked would take the user to the example.com website. This contributes to a clean, easy to read text or document. By default, browsers will usually display hyperlinks as such: * An unvisited link is usually blue and underlined * A visited link is usually purple and underlined * An active link is usually red and underlined When the cursor hovers over a link, depending on the browser and graphical user interface, some informative text about the link can be shown, popping up, not in a regular [[Window (computing)|window]], but in a special [[Mouse hover|hover box]], which disappears when the cursor is moved away (sometimes it disappears anyway after a few seconds, and reappears when the cursor is moved away and back). [[Mozilla Firefox]], [[Internet Explorer|IE]], [[Opera (web browser)|Opera]], and many other web browsers all show the URL. In addition, the URL is commonly shown in the [[status bar]]. Normally, a link opens in the current [[framing (World Wide Web)|frame]] or window, but sites that use frames and multiple windows for navigation can add a special "target" attribute to specify where the link loads. If no window exists with that name, a new window is created with the ID, which can be used to refer to the window later in the browsing session. Creation of new windows is probably the most common use of the "target" attribute. To prevent accidental reuse of a window, the special window names "_blank" and "_new" are usually available, and always cause a new window to be created. It is especially common to see this type of link when one large website links to an external page. The intention in that case is to ensure that the person browsing is aware that there is no endorsement of the site being linked to by the site that was linked from. However, the attribute is sometimes overused and can sometimes cause many windows to be created even while browsing a single site. Another special page name is "_top", which causes any frames in the current window to be cleared away so that browsing can continue in the full window.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)