Skip to main content

HTML Basic

What Is HTML?

HTML, which stands for Hypertext Markup Language, is the language used to describe structured documents and the language used to create web pages on the internet.

You can use any text editor to write the HTML code, such as  Notepad (PC) or TextEdit (Mac). For our demonstration, we will use a sublime text editor, which you can download at https://www.sublimetext.com/3

Save the file with the .html extension, and open it using a web browser of your choice.

html_file

What Is an HTML Tag?

HTML tags are the keywords on a web page that define how your web browser must format and display your web page.

Almost all tags contain two parts, an opening, and a closing tag. For example, <html> is the opening tag and </html> is the closing tag. Note that the closing tag has the same text as the opening tag, but has an additional forward-slash ( / ) character. 

There are a total of 100 HTML tags. We will divide them into categories and discuss the important ones in this article.

Basic HTML Tags

Head Tag

The head tag <head> contains all the elements describing the document. 

Title Tag

The title tag <title> specifies the HTML page title, which is shown in the browser’s title bar. 

Body Tag

The body tag <body> is where you insert your web page’s content. 

Paragraph Tag

A paragraph tag <p> is used to define a paragraph on a web page.

Heading Tag 

The HTML heading tag is used to define the heading of the HTML document. The <h1> tag defines the most important tag, and <h6> defines  the least.

Let’s practice using these tags and create a web page with them:

Title_and_heading_tag-html

Output_title_and_heading_tag

Formatting Tags

Emphasis tag

The HTML <em> tag is used to emphasize the particular text in a paragraph. 

Bold Tag

The <b> tag is used to make the text bold.

Italic Tag

The <i> tag is used to make the text italic.

Underline Tag

The <u> tag is used to set the text underline.

Bold_italic_underline

output_page

The <a> tag links one page to another page. The href attribute is used to define 

Anchor_tag-html_tags

Output_anchor_tag

List Tag

The <li> tag is used if you want to enter the contents in the listed order. There are two types of lists.

  • Ordered list <ol>
  • Unordered list <ul>

list_tag-html_tags

list_output

Image Tag

The <img> tag  is used to embed an image in an HTML document. You need to specify the source of the image inside the tag.

Image_tag

Image_tag_output-html_tags.

The center tag will center your content.

The Table Tag

The <table> tag is used to create a table in the HTML document.

The table row (<tr>) tag is used to make the rows in the table, and the table data (<td>) tag is used to enter the data in the table.

The style (<style>) tag is used to add methods to the content by typing the code in the HTML file itself. 

Table_tag-html_tags.

table_tag_output


Comments

Popular posts from this blog

HTML Basic 2

What Are HTML Elements? HTML elements The element usually starts with an opening tag, which consists of the name of the element. It's wrapped in opening and closing angle brackets. The opening tag indicates where the element begins. Similar to the opening tag, the closing tag is also wrapped in opening and closing angle brackets. But it also includes a forward slash before the element's name. Everything inside the opening and closing tags is the content. But not all elements follow this pattern. We call those that don't empty elements. They only consist of a single tag or an opening tag that cannot have any content. These elements are typically used to insert or embed something in the document. For example, the  <img>  element is used to embed an image file, or the  <input>  element is used to insert an input onto the page. < img src = " https://images.unsplash.com/photo-1610447847416-40bac442fbe6 " width = " 50 " > In the example abo