Webpage Development

WHAT IS HTML ?

 - HTML stands for Hyper Text Markup Language, which is the most widely used language on Web to develop web pages.

 - was created by Berners-Lee in late 1991 but "HTML 2.0" was the first standard HTML specification which was published in 1995. HTML 4.01 was a major version of HTML and it was published in late 1999. Though HTML 4.01 version is widely used but currently we are having HTML-5 version which is an extension to HTML 4.01, and this version was published in 2012.

- HTML5  is the fifth and current version of the HTML standard. It was published in October 2014 by the World Wide Web Consortium to improve the language with support for the latest multimedia, while keeping it easily readable by humans—and consistently understood by computers and devices such as web browsers, parsers, etc.

WHAT IS HTML ?

- Hypertext refers to the way in which Web pages (HTML documents) are linked together. Thus the link available on a webpage are called Hypertext.

- As its name suggests, HTML is a Markup Language which means you use HTML to simply "mark up" a text document with tags that tell a Web browser how to structure it to display.

- Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers. Now, HTML is being widely used to format web pages with the help of different tags available in HTML language.

BASIC HTML Document

<!DOCTYPE html>
<html>
  <head>
    <title>This is document title</title>
  </head>
  <body>
    <h1>This is a heading</h1>
    <p>Document content goes here.....</p>
  </body>
</html>

html tags

- HTML is a markup language and makes use of various tags to format the content. These tags are enclosed within angle braces <Tag Name>. Except few tags, most of the tags have their corresponding closing tags. For example <html> has its closing tag </html> and <body> tag has its closing tag </body> tag etc.

Heading tags

<!DOCTYPE html>
<html>
  <head>
    <title>Heading Example</title>
  </head>
  <body>
    <h1>This is heading 1</h1>
    <h2>This is heading 2</h2>
    <h3>This is heading 3</h3>
    <h4>This is heading 4</h4>
    <h5>This is heading 5</h5>
    <h6>This is heading 6</h6>
  </body>
</html>

Paragraph Tag

<!DOCTYPE html>
<html>
  <head>
    <title>Paragraph Example</title>
  </head>
  <body>
    <p>Here is a first paragraph of text.</p>
    <p>Here is a second paragraph of text.</p>
    <p>Here is a third paragraph of text.</p>
  </body>
</html>

- The <p> tag offers a way to structure your text into different paragraphs. Each paragraph of text should go in between an opening <p> and a closing </p> tag

Line Break Tag

<!DOCTYPE html>
<html>
  <head>
    <title>Line Break  Example</title>
  </head>
  <body>
    <p>Hello<br />
    You delivered your assignment ontime.<br />
    Thanks<br />
    Mahnaz</p>
  </body>
</html>

- Whenever you use the <br /> element, anything following it starts from the next line. This tag is an example of an empty element, where you do not need opening and closing tags, as there is nothing to go in between them.

Centering Content

<!DOCTYPE html>
<html>
  <head>
    <title>Centring Content Example</title>
  </head>
  <body>
    <p>This text is not in the center.</p>
    <center>
      <p>This text is in the center.</p>
    </center>
  </body>
</html>

- You can use <center> tag to put any content in the center of the page or any table cell.

Horizontal Lines

<!DOCTYPE html>
<html>
  <head>
    <title>Horizontal Line Example</title>
  </head>
  <body>
    <p>This is paragraph one and should be on top</p>
    <hr />
    <p>This is paragraph two and should be at bottom</p>
  </body>
</html>

- Horizontal lines are used to visually break up sections of a document. The <hr>tag creates a line from the current position in the document to the right margin and breaks the line accordingly.

attributes

- An attribute is used to define the characteristics of an HTML element and is placed inside the element's opening tag. All attributes are made up of two parts: a name and a value

  • The name is the property you want to set. For example, the paragraph <p> element in the example carries an attribute whose name is align, which you can use to indicate the alignment of paragraph on the page.

  • The value is what you want the value of the property to be set and always put within quotations. The below example shows three possible values of align attribute: left, center and right.

attributes

<!DOCTYPE html>
<html>
  <head>
    <title>Align Attribute  Example</title>
  </head>
  <body>
    <p align="left">This is left aligned</p>
    <p align="center">This is center aligned</p>
    <p align="right">This is right aligned</p>
  </body>
</html>

Insert Image

<!DOCTYPE html>
<html>
  <head>
    <title>Using Image in Webpage</title>
  </head>
  <body>
    <p>Simple Image Insert</p>
    <img src="/html/images/test.png" alt="Test Image" />
  </body>
</html>

- You can insert any image in your web page by using <img> tag. Following is the simple syntax to use this tag.

Anchor tags

<!DOCTYPE html>
<html>
  <head>
    <title>Hyperlink Example</title>
  </head>
  <body>
    <p>Click following link</p>
    <a href="http://www.tutorialspoint.com" 
       target="_self">Tutorials Point</a>
  </body>
</html>

- A link is specified using HTML tag <a>. This tag is called anchor tag and anything between the opening <a> tag and the closing </a> tag becomes part of the link and a user can click that part to reach to the linked document.

HTML Comments

<!DOCTYPE html>
<html>
  <head>  <!-- Document Header Starts -->
    <title>This is document title</title>
  </head> <!-- Document Header Ends -->
  <body>
    <p>Document content goes here.....</p>
  </body>
</html>

- Comment is a piece of code which is ignored by any web browser. It is a good practice to add comments into your HTML code, especially in complex documents, to indicate sections of a document, and any other notes to anyone looking at the code. Comments help you and others understand your code and increases code readability.

HTML Tables

<!DOCTYPE html>
<html>
  <head>
    <title>HTML Tables</title>
  </head>
  <body>
    <table border="1">
      <tr>
        <td>Row 1, Column 1</td>
        <td>Row 1, Column 2</td>
      </tr>
      <tr>
        <td>Row 2, Column 1</td>
        <td>Row 2, Column 2</td>
      </tr>
    </table>
  </body>
</html>

- The HTML tables allow web authors to arrange data like text, images, links, other tables, etc. into rows and columns of cells.

HTML Lists

- HTML offers web authors three ways for specifying lists of information. All lists must contain one or more list elements. Lists may contain:

  • <ul> - An unordered list. This will list items using plain bullets.
  • <ol> - An ordered list. This will use different schemes of numbers to list your items.
  • <dl> - A definition list. This arranges your items in the same way as they are arranged in a dictionary.

unordered list

<!DOCTYPE html>
<html>
  <head>
    <title>HTML Unordered List</title>
  </head>
  <body>
    <ul>
      <li>Beetroot</li>
      <li>Ginger</li>
      <li>Potato</li>
      <li>Radish</li>
    </ul>
  </body>
</html>

ordered list

<!DOCTYPE html>
<html>
  <head>
    <title>HTML Unordered List</title>
  </head>
  <body>
    <ul type="disc">
      <li>Beetroot</li>
      <li>Ginger</li>
      <li>Potato</li>
      <li>Radish</li>
    </ul>
  </body>
</html>

definition list

<!DOCTYPE html>
<html>
  <head>
    <title>HTML Definition List</title>
  </head>
  <body>
    <dl>
      <dt><b>HTML</b></dt>
      <dd>This stands for Hyper Text Markup Language</dd>
      <dt><b>HTTP</b></dt>
      <dd>This stands for Hyper Text Transfer Protocol</dd>
    </dl>
  </body>
</html>

Grouping HTML Elements

- There are two important tags which we use very frequently to group various other HTML tags (i) <span> tag and (ii) <div> tag

<!DOCTYPE html>
<html>
  <head>
    <title>HTML span Tag</title>
  </head>
  <body>
    <p>This is <span style="color:red">red</span> and this is   
       <span style="color:green">green</span>
    </p>
</body>
</html>
<!-- First group of tags -->
<div style="color:red">
   <h4>This is first group</h4>
   <p>Following is a list of vegetables</p>
   <ul>
   <li>Beetroot</li>
   <li>Ginger</li>
   <li>Potato</li>
   <li>Radish</li>
   </ul>
</div>

<!-- Second group of tags -->
<div style="color:green">
   <h4>This is second group</h4>
   <p>Following is a list of fruits</p>
   <ul>
   <li>Apple</li>
   <li>Banana</li>
   <li>Mango</li>
   <li>Strawberry</li>
   </ul>
</div>

HTML(Webpage Development)

By Geoff Diaz

HTML(Webpage Development)

  • 851