HTML stands for HyperText Markup Language. HTML is the basic building block of World Wide Web.
HTML is the standard markup language for creating Web pages.HTML describes the structure of a Web page.
HTML is the set of mark-up symbols or codes placed in a file that is intended for display on a webpage.
These mark-up symbols and codes identify structural elements such as paragraphs, headings,and lists.
HTML can also be used to place media (such as graphics, video, and audio) on a web pageand describe
fill-in forms.
The browser interprets the mark-up code and renders the page. HTML permits the platform
-independent display of information across a network. No matter what type of computer a web page was
created on, any browser running on any operating system can display the page.
HyperTextMarkup Language (HTML) is a modern standard markup language that uses common abbreviations called "tags".
HTML was first devised in 1989 by British physicist Tim Berners-Lee at CERN in Switzerland (the European organization for nuclear research) to share all computer-stored information between the CERN physicists. Berners-Leecreated a text browser to transfer information over the internet using hypertext to provide point-and-click navigation. In May 1990 this system was named the World Wide Web and was enhanced in 1993 when college student Marc Andreessen added an image tag. Now that HTML could display both text and images, the World Wide Web quickly became highly popular.
Mark-up languages consist of sets of directions that tell the browser software (and other user agents such as mobile phones) how to display and manage a web document.
Each individual mark-up code is referred to as an element or tag. Each tag has a purpose. Tags are enclosed in angle brackets, the < and > symbols. Most tags come in pairs: an opening tag and a closing tag. These tags act as containers and are sometimes referred to as container tags. For example, the text that is between the < title > and </title > tags on a web page would display in the titlebar on the browser window.
Some tags are used alone and are not part of a pair. For example, a <hr> tag that displays ahorizontal line on a web page is a stand-alone or self-contained tag and does not have a closing tag.
<!DOCTYPE html> <html> <head> <title>My First HTML Page</title> </head> <body> <h1>Welcome!</h1> <p>Paragraph</p> </body> </html>
<!DOCTYPE html>Defines the HTML version used in the document. In this case it is HTML5.
<html> Marks the beginning and the end of the webpage.
<head> Contains elements that are not part of the webpage shown in the browser window. It mainly contains information about the HTML document, called metadata.
<title>Specifies text that appears in the title bar of the web browser opening the page.
<body> Includes contents that are visible in the main window of a web browser.
HTML tags introduction |
||
---|---|---|
Sl.No. | Function | Code Reference |
1 | HeadingHTML heading elements are created using <h1>,<h2>,<h3>,<h4>,<h5> and <h6> .Each heading requires a matching closing tag and should only contain heading text. Typically, the heading’s font size and weight will reflect its importance, but headings also help readers quickly skim through a document by navigating its headings. Using HeadingsHeadings can be used to describe the topic they precede and they are defined with the <h1> to <h6> tags. Headings support all the global attributes.
Defining a heading:
|
<h1>My First Web Page </h1> |
2 | ParagraphsParagraphs are the most basic HTML element. Paragraphs are used in text content to read it easily and more readily understood. Paragraphs are contained within <p> and </p>tags. Each paragraph element is visually separated from the next one by the browser – typically leaving two empty lines between them. |
<p>This is a paragraph.</p> |
3 | Single Line Break<br> tag is used to provide a single line break between html elements. |
<p>This is a paragraph <br> with line break.</p> |
4 | Horizontal rule<hr>tag can be inserted between html elements to draw a line separating them. The<hr> tag and <br>tag are both single tags that need no matching closing tag. |
<p>Paragraph one.</p> <hr> <p>Paragraph two.</p> |
5 | Defining Preformatted Text<pre> tag is used to display spaces, tabs, line breaks etc exactly as written in the HTML file. It is very helpful in presenting text where spaces and line breaks are important like poem or code. |
<pre>This is a paragraph. </pre> |
6 | AttributesAttributes provide additional information about HTML elements. Attributes are always specified in the start tag. Attributes come in name/value pairs like: name="value".Commonly used style attributes: style="color:red" style="color:rgb(25,25,150);" style="color:red; background-color:yellow" style="background-image:url(car.jpg)" style="font-size:20px" style="font-family:georgia,garamond,serif,verdana;" style="text-align:center" style="width:50px" style="height:10px" style="margin:10px" style="padding:10px" style="border:3px solid red"; |
<h1 style="color:red;"> Sri Ramanuja e-Patashala </h1> |
7 | Class and ID AttributesClass and ID attributes are used for referring HTML elements for applying styles and scripts.The class attribute can be used on one or more tags and is used by CSS for styling. IDs however are intended to refer to a single element, meaning the same ID should never be used twice. IDs are generally used with JavaScript and internal document links. A class can be assigned to any number of elements. And an element can be assigned any number of classes. |
<style> .heading-red{ color:red; } #heading-blue{ color:blue; } </style> <h1 class="heading-red">Welcome<h1/> <h1 id="heading-blue">Welcome<h1/> |
8 | HTML HyperlinksIn Web terms, a hyperlink is a reference (an address) to a resource on the Web. Hyperlinks can point to any resource on the Web: an HTML page, an image, a sound file, a movie, and so on.By default, the content of a link is underlined. If it hasn’t been visited, it is blue. If it has been visited, it is purple. If it active, it is red. But there is no default for hovering. Setting the Targets for LinksSetting The target attribute tells the browser where to open the linked document. There are four defined targets, and each target name starts with an underscore(_) character:
|
<a href="lastpage.htm"> This text</a> is a link to a page on this Web site. <a href="https://www.google.com"> Google </a> is a link to a page on the World Wide Web. Opening in a new window: <a href="lastpage.htm" target="_blank">Last Page</a> Mail link: <a href="mailto:myfriend@gmail.com?subject=Hello!"> Image Link: <a href="default.htm"><img src="html.jpeg" alt="HTML tutorial" width="100" height="142" /> |
9 | Image TagTo add an image to a page, use the image tag. Image tags (img) do not have closing tags.The two main attributes you give to the img tag are src, the image source and alt, which is alternative text describing the image. Width and height attributes are used to adjust the pixel width and height of the area the image will occupy on the page. |
<img src="flower.jpg" alt="flower" width="104" height="142"> |
10 | Text FormattingWhile most HTML tags are used to create elements, HTML also provides in-text formatting tags to apply specific text-related styles to portions of text. This topic includes examples of HTML text formatting such as highlighting, bolding, underlining, subscript, and stricken text.
|
<b>This text is bold</b><br> <i>This text is italic</i><br> This is <sub>subscript</sub>and <sup>superscript</sup> |
11 | Unordered ListsAn unordered list is a collection of related items that have no special order or sequence. This list is created by using HTML <ul> tag. Each item in the list is marked with a bullet. |
<ul> <li>Beetroot</li> <li>Ginger</li> <li>Potato</li> <li>Radish</li> </ul> |
12 | Ordered ListsIf you are required to put your items in a numbered list instead of bulleted, then HTML ordered list will be used. This list is created by using <ol> tag. The numbering starts at one and is incremented by one for each successive ordered list element tagged with <li>. |
<ol> <li>Beetroot</li> <li>Ginger<</li> <li>Potato</li> <li>Radish</li> </ol> |
13 | TablesThe HTML tables allow web authors to arrange data like text, images, links, other tables, etc. into rows and columns of cells.The HTML tables are created using the <table> tag in which the <tr> tag is used to create table rows and <td> tag is used to create data cells. The elements under <td> are regular and left aligned by default. |
<table> <tr> <td>Name</td> <td>Class</td> <td>Marks</td> </tr> <tr> <td>Raghav</td> <td>8th</td> <td>590</td> </tr> </table> |
14 | HTML FormsWeb page forms are built from HTML elements to collect user inputs like user name, user address, contact phone number, email address etcForms contain HTML elements like inputbox, text areas, checkboxes, radio-buttons, submit buttons, etc. Users generally complete a form by entering text, selecting items, etc. and submitting this form to a web server for further processing. Input Types:Input types prohibit submission of the form if the user enters a value that isnot permitted and issue an error notice. Some also provide special controls that allow the user to easily select a permitted value. Input Type - Permitted input
|
<form method="GET" action="login.php"> <label>Username: <input type="text"></label> <label>Password: <input type="password"></label> <input type="submit"value="Submit"> </form> |