HTML Basic Tutorial
HTML (HyperText Markup Language) is the standard markup language for creating web pages. It defines the structure of the content on a web page using a system of tags and attributes.
HTML Tags
HTML tags are keywords surrounded by angle brackets used to define the structure of a web page. Tags usually come in pairs, with an opening tag and a closing tag.
Example:
<p>This is a paragraph.</p>
In the example above, the <p>
tag is the opening tag and the </p>
tag is the closing tag. The content between the opening and closing tags is the paragraph content.
HTML Attributes
HTML attributes provide additional information about an element. They are always included in the opening tag and are written as name/value pairs.
Example:
<a href="https://www.example.com">Link</a>
In the example above, the href
attribute specifies the URL that the link should go to. The attribute value is enclosed in double quotes.
HTML Elements
HTML elements are made up of tags, attributes, and content. They can be nested within each other to create a hierarchy of elements on a web page.
Example:
<div>
<p>This is a paragraph inside a div.</p>
</div>
In the example above, the <div>
element contains a <p>
element. This is an example of nesting elements within each other.
HTML Lists
HTML provides several types of lists for organizing content, including ordered lists (<ol>
), unordered lists (<ul>
), and definition lists (<dl>
).
Example:
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
In the example above, the <ul>
tag creates an unordered list, and the <li>
tags create list items within the list.
Conclusion
HTML is the foundation of web development and is essential for creating web pages. By understanding HTML tags, attributes, elements, and lists, you can create well-structured and organized web content.