HTML BRIEF

In this post we will understand simple examples of html to get start with html.

1. Understand the Basics

  • <html>: The root element.
  • <head>: Contains meta-information about the HTML document.
  • <title>: Sets the title of the webpage (displayed on the browser tab).
  • <body>: Contains the content of the webpage.
  • <h1>, <p>: Heading and paragraph tags, respectively.

Save the above content in a file with .html eg. “hello.html” extension and double click on the file

Output of the simple html program

2. Add Images

First of all create a folder and put an image into that folder and open that folder using any text editor make sure you html file and image file should be in the same folder.

In the above image we have image “file.jpg” and html file “pro.html” inside a folder named “learncodingself”.

<img src="file.jpg" alt=""> this line of code is responsible to display image on the web page

Output of the add image program

3. Creating Links in HTML

<a href="https://www.google.com">Go To Google</a> <a href="https://www.facebook.com">Go To Google</a> here the href=”address” attribute holds the address where we want to send the user when a link is clicked e.g. in this example when user click on the Go To Google text then user will reach to the www.google.com website.

Output of the links example program

4. HTML Lists

<ul>unordered list</ul> : display items without order
<ol> ordered list </ol> : display items in order
<li> list items </li> : to display single item in order list or unorder list

Output of html lists program