Learn Basic HTML Code in 10 Minutes

Share with others

Want to use HTML code to build a simple website? Learn the basics of HTML and check your practical experience of it using a free online HTML editor to see how it appears in your browser.

Even though most modern websites have user-friendly interfaces, knowing some basic HTML is useful.

If you are familiar with basic HTML code, you can modify the code produced by a programme like WordPress or build a simple webpage from scratch.

Let’s look at the basic HTML code that you’ll need to know.

10 Basic HTML Code Examples

1. <!DOCTYPE html>

This tag must be used at the start of every HTML document you produce. It makes sure a browser is aware that it is reading HTML and that HTML5, the most recent version, is what it should be doing.

Despite the fact that this isn’t an HTML tag, it’s nevertheless useful to know.

Example:

<!DOCTYPE html>

2. <html> </html>

This tag also indicates to a browser that it is reading HTML. Following the DOCTYPE tag, the <html> tag comes next, and you conclude it with a </html> tag at the conclusion of your file. Between these tags, the rest of your document should be placed.

Example:

<!DOCTYPE html>
<html>
....

</html>
Related Post: Top 5 HTML Tricks and Tips

3. <head> </head>

The <head> tag begins the header block of your file. The information you enter here does not show up on your website.

Instead, it includes information for your browser and metadata for search engines.

Your title will be in the <head> tag for simple pages, but that’s it. However, there are a few additional items you can add, which we’ll discuss next. You end it with a </head>.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>

4. <meta> tag

Metadata is placed in your page’s header area, just like the title tag. Search engines use metadata, which is details on what’s on your page, largely.

There are many different types of meta fields, but the following are some of the most popular:

  • meta description: description of your page.
  • meta keywords: your page focusing keywords.
  • meta author: author of your page.
  • meta viewport: A tag for ensuring that your page looks good on all devices.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
  <meta name="description" content="Learn Basic HTML Code">
  <meta name="keywords" content="HTML, CSS, JavaScript">
  <meta name="author" content="IFTIKHAR">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
</html>
Share with others
Iftikhar Qureshi
Iftikhar Qureshi

IFTIKHAR is a Website & SEO Developer, who also blogging addict, WordPress, HTML, PHP fanatic. Check out his social profile to contact him and view his past work.

Articles: 31

Leave a Reply

Your email address will not be published.