HTML Basics – Syntax definition

HTML DOCUMENT

It starts with <!DOCTYPE html html-file-extension-interface-symbol_318-45345>  //It’s used for rendering purpose.

All  elements must be written inside opening <html> and closing </html> tags.

Visible portion of markup comes within <body>…..</body> tags.

Example:

<!DOCTYPE html>
<html>
        <head>
                 <title> MY TITLE </title>
          </head>
        <body>
            //place your content here
            </body>
</html>

HTML HEADINGS  SYNTAX

<h1>,<h2>,<h3>,<h4>,<h5>,<h6> tags can be used to represent different text size.

It used for heading, sub-heading and so on.

Example:

<h1>heading1</h1>
<h2>heading2</h2>
<h3>heading3</h3>
<h4>heading4</h4>
<h5>heading5</h5>
<h6>heading6</h6>

COMMON ELEMENTS

Paragraph can be defined with <p></p> tags

Anchor tags can be used to generate hyperlinks <a>

Images can be added with <img> tag. It’s Syntax is explained in below example.

//PARAGRAPH
<p>This is our sample paragraph</p>

//HYPERLINK
<a href="http://www.syntaxdefinItion.com">link text</a>
/*
here, the target location is added to the href attribute.
Anything at place of link text will work as hyperlink on frontend.
*/

//IMAGES
//HTML images are defined with the <img> tag.
<img src="logo.jpg" alt="mywebsite.com" width="104" height="142">
/*The source file (src), alternative text (alt), and size (width and height) are provided as attributes:*/
Facebooktwittergoogle_pluspinterestlinkedinmail

Leave a Reply