Thursday, July 8, 2021

Building Blocks of html: HTML Tutorial

Building Blocks of HTML: 

An html document consist of its basic building blocks which are;

  1. Tags: An html tag surrounds the content and apply meaning to it. It is written between < and > brackets.
  2.  Attribute: An attribute in html provides extra information about the element and it is applied within the start tag. An html attribute contains two fields: name and value.
  3. Elements: An html element is an individual component of an html file. In an html file everything written within tags are termed  as html elements.

Syntax: 

<tag name attribute_name="attr_value"> content</tag name>

Example:-

<!DOCTYPE html>

<html>

<head>

<title>The basic building blocks of html</title>

</head>

<body>

<h2>The building blocks</h2>

<p> This is a paragraph tag</p>

<p style="color: red">The style is attribute of paragraph tag</p>

<span>The element contains tag, attribute and content</span>

</body>

</html>

0 comments:

Post a Comment