1. What is HTML?

HTML-Hyper Text terminology may be a terminology for creating an internet page. sites are usually viewed during a browser . they will include writing, links, pictures, and even sound and video. HTML is employed to mark and describe each of those sorts of content therefore the browser can display them correctly. HTML also can be wont to add meta information to an internet page. Meta information is typically not shown by web browsers and is data about the online page,for e.g, the name of the one that created the page. Cascading Style Sheets (CSS) is employed to style HTML elements while JavaScript is employed to control HTML elements and CSS styles.

Tags

HTML uses special bits of programming language called “tags” to let the browser skills an internet page should look. The tags usually are available pairs: a gap tag defines the beginning of a block of content and a closing tag defines the top of that block of content. There are many various sorts of tags, and every one features a different purpose. See Basic HTML Tags below for tag examples.

Example

<!DOC TYPE html> 
 <html> 
 <head> 
 <title> title of the page.</title> 
 </head> 
 <body> 
 <p>This is a paragraph tag.</p> 
 <a href=”https://booklet.today/”>This is a link tag.</a> 
 <img src=”image.jpg” alt=”Image”> 
 </body> 
  </html>

Basic HTML tags


Tag nameNameFunctionCode Example
<!DOCTYPE> DoctypeDefines the  Document type<!DOC TYPE html>
<html>  HTMLDefines an HTML document and starts a HTML document.<html>All code</html>
<head>  HeadContains any code that is not used to display elements on the web page<head></head>
<title>   TitleDefines the title of the web page (shown on the tab) and is entered within the <head><title>Web page</title>
<body>   BodyContains the visible elements of the web page (and contains the paragraph and more) <body>Html tags</body>
<h1> to <h6>   HeadingsHeadings of various sizes (<h1> being the largest) <h1>Heading</h1>
<p>   Paragraph                     Defines a paragraph of text <p>TEXT</p>
<a>    AnchorCreates active links to other web pages <a href=“booklet.today”>Visit our site</a>
<img>    ImageDisplays an image on the page<img src=“Image Url” alt=“Text displayed if image is not available”>
<br>    BreakInserts a single line breakText <br> Text

<center>    CenterMoves content to the center of the page<center>Code</center>
<script>    ScriptCreates a script in the web page, usually written in JavaScript<script>document.write(“Hello World!”)</script>

HTML – BASIC TAGS

Heading Tag

HTML defines six levels of headings. A heading element implies all the font changes, paragraph breaks before and after, and any white space necessary to render the heading. The heading elements are H1, H2, H3, H4, H5, and H6 with H1 being the highest or most important level and H6 the least. For example:

<html>
<head>
<title>Heading tag</title>
</head>
<body>
<H1>This is first heading</H1> 
<H2>This is  Second heading</H2> 
<H3>This is  Third heading</H3>
<H4>This is   Fourth heading</H4>
<H5>This is  fifth heading</H5>
<H6>This is  sixth heading</H6>
</body>
<//html>

Output:


This is first heading

This is second heading  

This is third  heading 

This is forth  heading 

This is fifth  heading 
This is sixth  heading 

Paragraph Tag

<p></p>Tag represents a paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs are often any structural grouping of related content, like images or form fields.


Example:


<!DOCTYPE html>
<html>
<head>
<title>Paragraph tag</title></head>
<body>
<p>1 st  paragraph of text.</p><p>2nd  paragraph of text.</p><p>3rd paragraph of text.</p></body>
</html>

Output:


  1 st  paragraph of the text.
2nd  paragraph of the  text.
3rd paragraph of the  text.

Content Centering  Tag


<center> tag to put any text in the center of the page.For Example.

<!DOC TYPE html>
<html>
<head>
<title> Content Centering tag</title>
</head>
<body>
<center>
<p> center of the text.</p>
</center>
</body>
</html>

Result:

center of the text

HTML Structure

  • Block-level elements take up the full available space and always start a new line in the document. Example of block tags includes headings and paragraphs.
  • Inline elements only take up as much space as they need and don’t start a new line on the page. They usually serve to format the inner contents of block-level elements. Some of the examples of inline tags include links and emphasized strings.

A typical HTML document will have the following structure:

<!DOC TYPE html>
 <html>
 <head>
  <title> name of the title.</title>
  </head>
  <body>
 <h1>This is a heading tag</h1>
  <p>This is a paragraph tag.</p>
  <p>This is another paragraph tag.</p>
  </body>
 </html>
The three block level tags that you need for your HTML document are:
  1. The <html></html> tag is the highest level element that encloses every HTML page.
  2. The <head></head> tag holds meta information such as the page’s title and charset.
  3. Finally, the <body></body> tag encloses all the content that appears on the page.

How does HTML work?

HTML documents end with the .html or .htm extension. You can view it using any web browser. The browser reads the HTML file and renders the content for users to view it.
Let’s take an example and see how the elements are structured in HTML:
<div>
<h1>The Main Heading</h1>
<h2>Subheading</h2>
 <p>Paragraph</p>
<img src=”/” alt=”Image”>
<p>second paragraph <a href=”booklet.today”>hyper link></a></p>
</div>

Comments