Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts
Let us now look at tags in more detail. A <TAG> tells the browser to do something. An ATTRIBUTE goes inside the <TAG> and tells the browser how to do it. A tag can have several attributes. Tags can also have default attributes. The default value is a value that the browser assumes if you have not told it otherwise. A good example is the font size. The default font size is 3. If you say nothing the size attribute of the font tag will be taken to have the value 3.






Consider the example shown in Fig.1A. Type the code specified in the figure in a text editor such as notepad and save it as “fig1A.html”. To render the file and see your page you can choose one of two ways:

  1. Find the icon of the html file you  just made (fig1A.htm) and double click on it. Or,
  2. In Internet Explorer, click on File/Open File and point to the file (fig 1A.htm).


Figure 1A. A Simple Web Page


HTML Tag

As shown in Figure 1A above, <HTML> is a starting tag. To delimit the text inside, add a closing tag by adding a “/” to the starting tag. Most but not all tags have a closing tag. It is necessary to write the code for an HTML page between <HTML> and </HTML>. Think of tags as talking to the browser or, better still, giving it instructions. What you have just told the browser is 'this is the start of an HTML document' (<HTML>) and 'this is the end of an HTML document' (</HTML>). Now you need to put some matter in between these two markers. Every HTML document is segregated into a HEAD and BODY. The information about the document is kept within <HEAD> tag. The BODY contains the page content.

TITLE Tag

The only thing you have to concern yourselves with in the HEAD tag (for now) is the TITLE tag. The bulk of the page will be within the BODY tag, as shown in Figure.1A.

<HEAD>
<TITLE> MY WEB </TITLE>
</HEAD>


Here the document has been given the title my web. It is a good practice to give a title to the document created. What you have made here is a skeleton HTML document. This is the minimum required information for a web document and all web documents should contain these basic components. Secondly, the document title is what appears at the very top of the browser window.



BODY Tag

If you have a head, you need a body. All the content to be displayed on the web page has to be written within the body tag. So whether text, headlines, text-box, check-box or any other possible content, everything to be displayed must be kept within the BODY tag as shown in Figure 1A. Whenever you make a change to your document, just save it and hit the Reload/Refresh button on your browser. In some instances just hitting the Reload/Refresh button doesn’t quite work. In that case hit Reload/Refresh while holding down the SHIFT key.

The BODY tag has following attributes:
  • BGCOLOR: It can be used for changing the background color of the page. By default the background color is white.
  • BACKGROUND: It is used for specifying the image to be displayed in the background of the page.
  • LINK: It indicates the color of the hyperlinks, which have not been visited or clicked on.
  • ALINK: It indicates the color of the active hyperlink. An active link is the one on which the mouse button is pressed.
  • VLINK: It indicates the color of the hyperlinks after the mouse is clicked on it.
  • TEXT: It is used for specifying the color of the text displayed on the page.


Consider the following example:



Figure 1B. A Page with a Background Color





The values specified for BGCOLOR and TEXT tags indicate the color of the background of the page and that of the text respectively. These are specified in hexadecimal format. The range of allowable values in this format is from “#000000” to “#FFFFFF”. The“#” symbol has to precede the value of the color so as to indicate to the browser that has to be interpreted as a hexadecimal value. In this six digit value, the first two digits specify the concentration of the color red, the next two digits specify the concentration of the color green and the last two digits specify the concentration of the color blue. So the value is a combination of the primary colors red, green and blue and that is why it is called RGB color. If we specify the value “#FF0000”, the color appears to be red.”#000000” gives black and “#FFFFFF” gives the color white. You also have the option of specifying the color by giving its name, like: <BODY TEXT = “WHITE”>. You can also specify a background image instead. (Note that the image should be in the same folder as your HTML file. More on this below).

Try it out with the example HTML below:


Figure 1C. A Page with an Image in the Background


Posted on Wednesday, December 11, 2013 by Unknown

No comments

You would by now have been introduced to the Internet and the World Wide Web (often just called the Web) and how it has changed our lives. Today we have access to a wide variety of information through Web sites on the Internet. We can access a Web site if we have a connection to the Internet and a browser on our computer. Popular browsers are Microsoft Internet Explorer, Netscape Navigator and Opera. When you connect to a Web site, your browser is presented with a file in a special format by the Web server on the remote computer. The contents of the file are stored in a special format using Hyper Text Markup Language, often called HTML This format is rendered, or interpreted, by the browser and you then see the page of the web site from your computer. HTML is one language in a class of markup languages, the most general form of which is Standard Generalized Markup Language, or SGML. Since SGML is complex, HTML was invented as a simple way of creating web pages that could be easily accessed by browsers.

HTML is a special case of SGML. HTML consists of tags and data. The tags serve to define what kind of data follows them, thereby enabling the browser to render the data in the appropriate form for the user to see. There are many tags in HTML, of which the few most important ones are introduced in this unit. HTML files usually have the extension “.htm” or “.html”. If you want to create Web pages, you need a tool to write the HTML code for the page.  This can be a simple text editor if you are hand-coding HTML. You also have sophisticated HTML editors available that automate many (though not all) of the tasks of coding HTML. You also need a browser to be able to render your code so that you can see the results.


WHAT IS HTML?

As indicated earlier, HTML stands for Hypertext Markup Language. HTML provides a way of displaying Web pages with text and images or multimedia content. HTML is not a programming language, but a markup language. An HTML file is a text file containing small markup tags. The markup tags tell the Web browser, such as Internet Explorer or Netscape Navigator, how to display the page. An HTML file must have an htm or html file extension. These files are stored on the web server. So if you want to see the web page of a company, you should enter the URL (Uniform Resource Locator), which is the web site address of the company in the address bar of the browser. This sends a request to the web server, which in turn responds by returning the desired web page.  The browser then renders the web page and you see it on your computer.

HTML allows Web page publishers to create complex pages of text and images that can be viewed by anyone on the Web, regardless of what kind of computer or browser is being used. Despite what you might have heard, you don’t need any special software to create an HTML page; all you need is a word processor (such as Microsoft Word) and a working knowledge of HTML. Fortunately, the basics of HTML are easy to master.  However, you can greatly relieve tedium and improve your productivity by using a good tool.  A simple tool is Microsoft FrontPage that reduces the need to remember and type in HTML tags.  Still, there can always be situations where you are forced to hand code certain parts of the web page. HTML is just a series of tags that are integrated into a document that can have text, images or multimedia content. HTML tags are usually English words (such as block quote) or abbreviations (such as p for paragraph), but they are distinguished from the regular text because they are placed in small angle brackets. So the paragraph tag is <p>, and the block quote tag is <blockquote>. Some tags dictate how the page will be formatted (for instance, <p> begins a new paragraph), and others dictate how the words appear (<b> makes text bold). Still others provide information - such as the title - that doesn’t appear on the page itself. The first thing to remember about tags is that they travel in pairs. Most of the time that you use a tag - say <blockquote> - you must also close it with another tag - in this case, </blockquote>. Note the slash - / - before the word “blockquote”; that is what distinguishes a closing tag from an opening tag.

The basic HTML page begins with the tag <html> and ends with </html>. In between, the file has two sections -the header and the body.  The header - enclosed by the <head> and </head> tags -contains information about a page that will not appear on the page itself, such as the title. The body - enclosed by <body> and </body> - is where the action is. Everything that appears on the page is contained within these tags.

HTML pages are of two types:
  • Static
  • Dynamic

Static Pages

Static pages, as the name indicates, comprise static content (text or images). So you can only see the contents of a web page without being able to have any interaction with it.

Dynamic Pages

Dynamic pages are those where the content of the web page depend on user input. So interaction with the user is required in order to display the web page. For example, consider a web page which requires a number to be entered from the user in order to find out if it is even or odd. When the user enters the number and clicks on the appropriate button, the number is sent to the web server, which in turn returns the result to the user in an HTML page.

Posted on Tuesday, December 10, 2013 by Unknown

No comments