Web development has become one of the most valuable skills in the world of technology. With the advancement of the internet, many businesses and individuals are striving to establish an online presence. And a fundamental necessity of an online presence is creating a webpage. Creating a webpage does not necessarily require expertise in web development. However, it’s a fundamental requirement to understand HTML (Hypertext Markup Language), which is the building block of any webpage. In this article, you will learn what HTML is all about, the basic elements of HTML, and how to create a webpage using HTML.
What is HTML?
HTML stands for Hypertext Markup Language. It is the standard markup language used to build Web pages. Markup language is known as a set of codes and symbols that define the structure of a document. HTML is the primary language for creating web pages along with Cascading Style Sheets (CSS) and JavaScript. HTML code consists of a series of elements that define a web page’s structure and content.
Basic Elements of HTML
HTML follows a clear and precise syntax to create a webpage. The fundamental element of HTML is tags. The tags define the content of a webpage and how it’s presented. The <html> tag tells the browser that it is reading an HTML document. The <head> tag contains the metadata about the webpage such as the title, author, character set, and other essential details. The <body> tag is responsible for displaying the content on the webpage.
Headings
Headings come in different sizes, and they are defined with H1, H2, H3, H4, H5, and H6 tags. The <h1> tag represents the primary heading of the webpage. It is the most critical element on the webpage and should only appear once. The <h2> to <h6> tags are used for subheadings.
Paragraphs
A paragraph is defined by enclosing the text within the <p> tag. The <p> tag creates a visible line break before and after its contents.
Links
Links are used to connect other web pages or documents on the same website. Links in HTML are defined using the <a> tag. Additionally, you can customize links with attributes such as HREF, TARGET, and REL.
Images
Images can be added to a webpage using the <img> tag. The tag includes attributes such as SRC (source), ALT (alternative text), WIDTH, and HEIGHT that define the image’s position and size.
Creating a Webpage Using HTML
To create a webpage using HTML, you can use any text editor such as Notepad, Atom, Visual Studio Code, or Sublime Text. These editors offer syntax highlighting, code completion, and other productivity features that make coding easier. Here’s how you can create a basic webpage using HTML.
Step 1: Create a new HTML document
Open your text editor and create a new document. Type the following code to create a basic HTML document.
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<h1>Welcome to My Webpage</h1>
<p>This is a basic HTML webpage.</p>
</body>
</html>
- <!DOCTYPE> tag at the beginning of the document declares that it follows the HTML5 standard. The <html> tag encloses the entire document
- <head> tag contains the metadata about the webpage.
- <title> tag sets the document’s title, which is displayed on the browser’s title bar.
- <body> tag contains the visible content, including headings, paragraphs, and other page elements.
Step 2: Add Content to the Webpage
To add more content to your webpage, insert the relevant HTML elements. Consider the following example:
<body>
<h1>Welcome to My Webpage</h1>
<p>This is a basic HTML webpage.</p>
<h2>My Favorite Movies</h2>
<ul>
<li>The Godfather</li>
<li>The Shawshank Redemption</li>
<li>The Dark Knight</li>
</ul>
<h3>About Me</h3>
<p>I'm a software developer with a passion for web development.</p>
</body>
The code creates a bulleted list of favorite movies and adds a paragraph about the author. The
tag creates an unordered list, while the tag adds list items to the list.
Step 3: Save the Document and Test the Webpage
Once you have added your content, save the HTML document with the .html extension. Open the file in your web browser to preview the content. If everything is done correctly, you should see a webpage with your content displayed.
Conclusion
Creating a webpage using HTML is the fundamental requirement for establishing an online presence. In this article, we have discussed what HTML is, the basic elements of HTML, and how to create a webpage using HTML. Whether you’re an aspiring web developer or a business owner looking to create a webpage, understanding HTML is a crucial skill that can help you achieve your goals. By following the examples in this article, you should now have a basic understanding of HTML and be able to create your own webpage using HTML.
📕 Related articles about HTML
- How to Use Bootstrap in HTML
- How to Code HTML Emails: Best Practices for Email Development
- HTML Styles: A Comprehensive Guide to Styling Web Pages
- How to make website with HTML and CSS
- How to Start a HTML File
- Understanding HTML Paragraphs