URL in HTML is the section 16 of Beginner’s Guide to HTML.
URL is another word for a web address. If you can remember we used URLs in several situations previously. When we discussed about images in the Add Images on HTML section, in the tag we entered a url as the src attribute value. To define the address of the image located. Also we used URLs in the HTML Hyperlinks section too. We defined the hyperlink reference URL as the href attribute value of anchor tag . The location of the web page that needed to jump into.
Let’s get into more detail about what is an URL.
URL – Uniform Resource Locator
A URL can be composed of words, such as “www.letsdnd.com”, or an Internet Protocol (IP) address: 22.214.171.124. Most people like to enter the name of the website when surfing the net, because names are much easier to remember than numbers. Web browsers request web pages from web servers by using an URL. When you click on a link in a HTML web page, an underlying anchor tag points to an address on the world wide web (www).
Clear benefit of the URL is, it is used to address a document or other data on the world wide web. Other data means, it can be an image, an audio, a video, or some kind of that stuff.
Let’s look at what’s in a URL. A URL is contain of a scheme, host, domain, port, directory path and a filename.
|scheme||Defines the type of Internet service. The most common type is http. Following are few schemes that can be used also.|
|host||Defines the domain host. The default host for http is www.|
|domain||Defines the Internet domain name.|
|port||Defines the port number at the host. The default port number for http is 80.|
|path||Defines a path at the server. If omitted, the document must be stored at the root directory of the web site.|
|filename||Defines the name of a document/resource|
||A text you want to pass in to the file|
If you can remember, in the previous section we discussed about Character Encoding. There we learned about ASCII character set. Since URLs often contain characters outside the ASCII character set, the URL has to be converted into a valid ASCII format. Because URLs can only be sent over the Internet using the ASCII character set. So the URL encoding converts characters into a format that can be transmitted over the Internet.
In this process it replaces non ASCII characters with a “%” followed by two hexadecimal digits. As URLs cannot contain spaces, also this process replaces a space with a + sign.
So if I take the unsafe ASCII character ‘ © ‘, this one converted in the encoding process as the ‘%A9’.
If we take this text message ‘We went to movie’ over a URL as argument, it converts as ‘We+went+to+movie’.
So in this section we learned about what contained in a URL and how was it encoded and passed over through internet. In the next section we’re going to learn about other languages which are related with the HTML.
Let’s look at other Languages Related with HTML.