HTML basic syntax and Elements

 

HTML:


Hyper Text Markup language (HTML)  was  devised as an easy means to format textual documents .Hyper text transfer protocol ( HTTP ) is the  method for delivering HTML documents which the client browser then renders  into an on-screen  image. It is a standard markup language for making web pages and you can make your own website. To date HTML  has gone through five major standards, including the  latest HTML5 .In addition to HTML , Cascading Style Sheets(CSS) , EXTENSIBLE MARKUP LANGUAGE (XML) and Javascript also provides valuable  contribution to the way of the web.




HTML SYNTAX:-

The concept and use of HTML is straightforward. 

Individual tags , special text strings that are interpreted  as formatting commands  by the browser are placed within a document to lend structure and format accordingly. Each tag has a beginning and an ending tag.

Each tag begins with a left-pointing angle bracket (<)and ends with a right pointing angle bracket.(>).

Between the brackets are keywords indicating the type of tag. Beginning tags include any parameters necessary for the tag , ending tags contain only the keyword prefixed by a slash(/).

for example, to bold a text  we will surround it with bold tags <b> and </b>.

 

YOUR FIRST HTML PAGE:-

The example produces a simple  HTML document with one line of text.








   output:-


                  HTML ELEMENTS:-

HTML provides more than 90 elements

Categories of Elements

  1. Top-level elements
  2. Head elements
  3. Block level elements
  4. Inline elements

Top-level elements:

Html, head and body

Head elements

Elements placed inside head including page title, style(css stylesheet),link(related documents),
meta(data about the document),base(URL of document),script(client-side scripting)

Block-level elements

elements behaving like paragraphs includingh1 to h6(headings),p(paragraph),pre(preformatted text),
div(designated block), ul, ol , dl(lists),table(tabulation) and form (user input forms)
always start on a br new line
,and any element immediately after the block element also begin on a new line.

Inline elements

elements behaving like words, characters or phrases including a(anchor or hyperlink), br(brek line),image(picture or graphics),
em(emphasis),strong(strong emphasis),sub(subscript),sup(superscript),code(computer code),var(variable name),
kbd(text for user input),samp(sample output) ,and span
(designated inline scope).


when an element is placed inside another, the containing element is the parent and the contained element is the child

COMMENTS:

Comments in an HTML document is given as  <!-- a sample comment --> . Text  and HTML elements inside the comment  tag are ignored by the browser. Be sure not to put two consecutive dashes inside a comment. It is a good practice  to include comments in HTML document as notes ,reminders or documentation to make maintenance easier.

 
GENERAL SYNTAX RULES:

  • All tags  begin with " < " and ends with " > ". The tag name is given immediately  following the leading  < . Make sure  the tag is spelled correctly. Unrecognized tags are ignored by browsers .Any attributes are given  following the tag name in the form :
            <tag attribute1="value" attribute2="value" . . .  >
  • Tag and attribute names are given in lower case . Attributes are always given in the form  
          attribute_name  = "value"
           where the value is case sensitive.
  • Most elements involve opening and  closing  tags . Other elements such as <br> and <img> ,do not have closing tags  and are known as empty elements . 
  • Elements must be well-formed. This means no missing opening or closing  tags and  no improper nesting. For example, 
           <p>learning <strong>HTML</p></strong>
          The  correct nesting is
           <p>learning<strong>HTML</strong></p>
  • Attributes can be required or optional and can be given in any order.
  •   Extra White  space  and line breaks are allowed between the tag name and attributes and around the = sign inside an attribute.
  • T he  body element may contain only  block-level HTML elements . Freestanding text or inline elements are not allowed directly in the body element.
        
          Learning HTML include knowing  the elements , their attributes, where they can be placed and the elements they can contain.







  





Comments

Popular posts from this blog

Mastering Firebase for Android Apps

Getting Started With Android Development