demosthenes.info

Iā€™m Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with , and . To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

web developer guide

my books

Book cover of Pro CSS3 AnimationPro CSS3 Animation, Apress, 2013

my projects

CSSslidy: an auto-generated #RWD image slider. 1.5K of JS, no JQuery. Drop in images, add a line of CSS. Done.

tipster.ioAutomatically provides local tipping customs and percentages for services anywhere.

Remote Links

html / links

Estimated reading time: 1 minute, 9 seconds

On the web you can link to absolutely anything, but let's say that you want to create a link to the front page of CNN.com. Obviously CNN is not under your control. In this case you must provide the full and complete URL - a simple www.something.com is not sufficient.

Read this article on <a href="http://www.cnn.com">CNN</a>

Note that the easiest way to guarantee that you have the URL correct is to navigate to the site, page, or resource using your browser, highlight all the text in the URL bar (ALT+D), copy it (CTRL / CMD + C) and paste it into the appropriate href value in your page.

Also note that some longer URLs, particularly (but not exclusively) those that contain GET information, may cause the W3C to claim it is invalid. This is not your fault. You will simply need to replace some characters in the URL with their HTML entity equivalents: for example, writing &amp; to replace any & characters in the URL string.

Note that modern browsers do allow two code shortcuts in order to save file size. First, the opening http: may be dropped, so long as the // remains to indicate that the information is a URL; second, if you are writing HTML5, quotes are optional so long as the URL does not contain any "weird" characters. Under those conditions, our link could become:

<a href=//www.cnn.com>Go to CNN</a>
comments powered by Disqus

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.