HTML Tags & Elements

HTML tags can control how the information and format of a web page are displayed in your browser. Most HTML tags have two pieces: an opening and a closing section, and any content types within those sections has an effect based on how the tag works.

HTML Elements are made up of HTML tags and content. Between the start and end tags is the HTML element. It is critical that your material be included.

HTML Attributes

An HTML attribute is a word for a property that provides more information about HTML elements. id, class, style, and other HTML attributes are only a few instances. Many attributes are global and can be applied to any element, but we only employ a few of them for certain HTML elements. In the following example, h1 tag has an id called “heading”

<h1 id="heading">Hello, World!</h1>

Common Tags & Elements

Example

<!DOCTYPE html>
<html>  
	<head>    
		<title>Title of the site</title>  
	</head>  
	<body>    
		<h1>Heading</h1>    
		<h2>Subheading</h2>    
		<p>This is a very long paragraph</p>    
		<a href="<https://linccodes.vercel.app>">My Site</a>    
		<img src="<https://cdn-icons-png.flaticon.com/512/919/919827.png>" alt="Image" width="100" height="100"/>    
		<ul>      
			<li>Item 1</li>      
			<li>Item 2</li>    
		</ul>  
	</body>
</html>

https://codepen.io/linccodes/pen/RwjLwqM

<!DOCTYPE html>

The document type is represented by the <!DOCTYPE> declaration, which aids browsers in appropriately displaying web pages. Located at the start of the code. HTML5 uses the <!DOCTYPE> declaration.

<html></html>

The root of an HTML document is represented by the <html> tag. All other HTML elements are contained within the <html> tag.

<head>  
	<meta charset="UTF-8">  
	<meta http-equiv="X-UA-Compatible" content="IE=edge">  
	<meta name="viewport" content="width=device-width, initial-scale=1.0">  
	<meta name="author" content="Linc Codes">   
	<meta name="description" content="A little about everything">  
	<meta name="keywords" content="html,css,javascript">  
	<link rel="stylesheet" href="style.css">  
	<style>    
		/* internal styles go here */  
	</style>  
	<script defer src="main.js"></script>  
	<script>    
		// js code goes here  
	</script>  
	<title>The Web</title>
</head>

The <html> and <body> tags are separated by the <head> element, which is a container for metadata. The term metadata refers to information about the HTML document. The metadata isn't shown by the browser. The document title, character set, styles, scripts, and other meta information are often defined via metadata.

<body>Content shown by the browser goes here</body>

The body of the document is defined by the <body> tag. The <body> element includes all of an HTML document's content, including headings, paragraphs, images, hyperlinks, tables, lists, and so on.

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>