An Intro To Web Dev Part-1: HTML Markups
Introduction
HTML (Hypertext Markup Language) is a foundational language of web development. It is used to create the structure of web pages and defines the different elements of a web page such as headings, paragraphs, images, and links. In this article, we will dive deep into HTML and explore its different elements and their programmable properties.HTML Document Structure
An HTML document consists of several sections. Here's a basic structure of an HTML document:html<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
The <!DOCTYPE html> declaration at the beginning tells the browser that the document is an HTML5 document. The <html> element contains the entire HTML document, and the <head> element contains meta information about the document, such as the title. The <body> element contains the content of the document.
HTML Elements
HTML elements define the different parts of a web page. Here are some of the most commonly used HTML elements:1. Headings: Headings are used to define the main headings of a document. HTML has six levels of headings, from <h1> to <h6>. Here's an example:
html<h1>Main Heading</h1>
html<p>This is a paragraph.</p>
html<a href="https://www.example.com/">Link</a>
html<img src="image.jpg" alt="Image">
html<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
html<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
HTML Attributes
HTML elements can have attributes that provide additional information about the element. Here are some commonly used attributes:1. id: The id attribute is used to give an element a unique identifier.
html<div id="container"></div>
html<div class="box"></div>
html<img src="image.jpg" alt="Image">
html<a href="https://www.example.com/">Link</a>
Comments
Post a Comment