HTML Tutorial

2. HTML tags

HTML Tags
 HTML tags contain three main parts: opening tag, content and closing tag. But some HTML tags are unclosed tags. When a web browser reads an HTML document, browser reads it from top to bottom and left to  right. HTML tags are used to create HTML documents and render their properties.  Each HTML tags have different properties.
Syntax
<tag> content </tag>
HTML Tag Examples

Note: HTML Tags are always written in lowercase letters. The basic HTML tags are given below:
         <p> Paragraph Tag </p>
         <h2> Heading Tag </h2>
         <b> Bold Tag </b>
         <i> Italic Tag </i>
         <u> Underline Tag</u>

Unclosed HTML Tags
Some HTML tags are not closed, for example br and hr.
<br> Tag: br stands for break line, it breaks the line of the code.
<hr> Tag: hr stands for Horizontal Rule. This tag is used to put a line across the webpage.
HTML Meta Tags
DOCTYPE, title, link, meta and style
HTML Text Tags
<p>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <strong>, <em>, <abbr>, <acronym>, <address>, <bdo>, <blockquote>, <cite>, <q>, <code>, <ins>, <del>, <dfn>, <kbd>, <pre>, <samp>, <var> and <br>

HTML Image and Object Tags
<img>, <area>, <map>, <param> and <object>
HTML List Tags
<ul>, <ol>, <li>, <dl>, <dt> and <dd>
HTML Table Tags
table, tr, td, th, tbody, thead, tfoot, col, colgroup and caption
HTML Form Tags
form, input, textarea, select, option, optgroup, button, label, fieldset and legend
HTML Scripting Tags
script and noscript

Introduction

                       HTML tutorial or HTML 5 tutorial provides basic and advanced concepts of html. Our HTML tutorial is Developed for beginners and professionals. The major points of HTML are given below:
  • HTML stands for Hyper Text Markup Language.
  • HTML is used to create web pages.
  • HTML is widely used language on the web.
  • We can create static website by HTML only.
HTML 5 Tags
           In this tutorial, we will learn HTML 5 tags such as audio tag, video tag, canvas tag, HTML svg, HTML Geo-location, HTML drag and drop etc.

All HTML Tags
          At last, we will learn all HTML tags one by one for example, marquee tag, textarea tag, br tag, hr tag, pre tag, h tag, code tag, input tag, title tag, meta tag, script tag, style tag etc.

What is HTML ?
           HTML is an acronym which stands for Hyper Text Markup Language. Let's see what is Hyper Text and what is Markup Language?

Hyper Text: Hyper Text simply means "Text within Text". A text has a link within it, is a hypertext. Every time when you click on a word which brings you to a new webpage, you have clicked on a hypertext.
Markup language: A markup language is a programming language that is used make text more interactive and dynamic. It can turn a text into images, tables, links etc.

       An HTML document is made of many HTML tags and each HTML tag contains different content.
              <!DOCTYPE>
              <html>
              <body>
              <h1>Write Your First Heading</h1>
              <p>Write Your First Paragraph.</p>
              </body>
              </html>
Output:



Description of HTML example
DOCTYPE: It defines the document type.
html : Text between html tag describes the web document.
body : Text between body tag describes the body content of the page that is visible to the end user.
h1     : Text between h1 tag describes the heading of the webpage. p : Text between p tag describes the paragraph of the webpage.

Brief History of HTML
            In the late 1980's , A physicist, Tim BernersLee who was a contractor at CERN, proposed a system for CERN researchers. In 1989, he wrote a memo proposing an internet based hypertext system.
           Tim BerneLrsee is known as father of HTML. The first available description of HTML was a
document Called "HTML Tags" proposed by Tim in late 1991.

Features of HTML
  • It is a very easy and simple language. It can be easily understood and modified.
  • It is very easy to make effective presentation with HTML because it has a lot of formatting tags.
  • It is a markup language so it provides a flexible way to design web pages along with the text.
  • It facilitates programmers to add link on the web pages (by html anchor tag) , so it enhances the interest of browsing of the user.
  • It is platformindependent because it can be displayed on any platform like Windows, Linux and Macintosh..etc..
  • It facilitates the programmer to add Graphics, Videos, and Sound to the web pages which makes it more attractive and interactive.

String Comparision Using Bubble Sort



1.    Write a program to find whether two given strings are permutations of each other.  A string str1 is a permutation of str2 if all the characters in str1 appear the same number of times in str2 and str2 is of the same length as str1.

Input: Two strings S1 and S2
Output:
yes - if they satisfy given criteria
no - otherwise

Constraints:
1 <= len(S1), len(S2) <= 100.
Characters from ASCII range 0 to 127.
White space will not be given in the string.




#include<iostream>
#include<string>
using namespace std;

string  asc(string str)
    {
    int i,j,temp;
   for(i=0;str[j]!='\0';i++)
    {
        for(j=i+1;str[j]!='\0';j++)
        {
            if(str[j]<str[i])
            {
                temp=str[j];
                str[j]=str[i];
                str[i]=temp;
            }
        }
    }
    return str;
    }


    int stringCompare(string str1,string str2)
    {
    int i,flag=0;

    for(i=0;str1[i]!='\0' && str2[i]!='\0';i++)
        {
         if(str1[i]!=str2[i])
            {
             flag=1;
             break;
            }
        }

    if (flag==0 && str1[i]=='\0' && str2[i]=='\0')
         return 1;
    else
         return 0;

}

int main()
{
    string s1,s2;
    int res;
    cout<<"Enter the string 1:";
    cin>>s1;
    s1=asc(s1);
    cout<<"Enter the string 2:";
    cin>>s2;
    s2=asc(s2);
    res=stringCompare(s1,s2);
    if(res==0)
        cout<<"\nYes";
    else
        cout<<"No";
}