HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

HTML Basic Example:

"HTML Basic" isn't a specific term with a singular definition, but it likely refers to the fundamental building blocks of HyperText Markup Language (HTML).

HTML Documents

Get Steps : How to Create an HTML File

  1. Step 1: Add a declaration. ...
  2. Step 2: Add an element. ...
  3. Step 3: Add a language attribute. ...
  4. Step 4: Add a head and body section. ...
  5. Step 5: Add a title in the head section. ...
  6. Step 6: Add HTML elements in the body section.

A Simple HTML Document

Example

    
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1> <p>My first paragraph.</p>
</body> </html>
You can click on above box to edit the code and run again.

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration tag is used by the web browser to understand the version of the HTML used in the document. Current version of HTML is 5 and it makes use of the following declaration:

    

<!DOCTYPE html>

There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing <!DOCTYPE> tag along with other HTML tags.

HTML Headings

Any document starts with a heading. You can use different sizes for your headings. HTML also has six levels of headings, which use the elements <h1>,<h2><h3>, <h4>, <h5>, and <h6>. While displaying any heading, browser adds one line before and one line after that heading.

Example

    
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Heading Example</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
       
You can click on above box to edit the code and run again.

Output

This is heading 1

This is heading 2

This is heading 3

This is heading 4

This is heading 5
This is heading 6

HTML Paragraphs

The <p> tag offers a way to structure your text into different paragraphs. Each paragraph of text should go in between an opening <p> and a closing </p> tag as shown below in the example:

Example

    
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Paragraph Example</title>
</head>
<body>
<p>Here is a first paragraph of text.</p>
<p>Here is a second paragraph of text.</p>
</body>
</html>
       
       
You can click on above box to edit the code and run again.

Output

Here is a first paragraph of text.

Here is a second paragraph of text.

HTML Links

HTML links are defined with the <a> tag:

Example

 <a href="https://www.codelines.in">codelines</a>
You can click on above box to edit the code and run again.

Output:

HTML Images

HTML images are defined with the <img> tag:

Example

 <img src="codelines.jpg alt="codelines" width="280" height="202"</img>
 
You can click on above box to edit the code and run again.

Output:

codelines1