Learn HTML For Beginners

HTML Basic Elements

<strong> Element

The <strong> tag is a phrase tag. It defines important text. The HTML Strong Element (<strong>) gives text strong importance, and is typically displayed in bold.


<strong>Strong Text</strong>
 

Here is the result of this code:

Strong Text

<b> Element

The HTML <b> Element represents a span of text stylistically different from normal text, without a conveying any special importance or relevance. The <b> tag specifies bold text.


<p>This is normal text <b>and this is bold text</b>.</p>
 

Here is the result of this code:

This is normal text and this is bold text.

<hr> Element

The <hr> element is used to separate content in an HTML page.


<b>HTML</b> <p>HTML is a language for describing web pages.</p> <hr>
<b>CSS</b>
<p>CSS defines how to display HTML elements.</p>
 

Here is the result of this code:

HTML

HTML is a language for describing web pages.


CSS

CSS defines how to display HTML elements.

<br> Element

The HTML <br> Element produces a line break in text.


<p>To break lines<br>in a text, <br>use the br element.</p>
 

Here is the result of this code:

To break lines
in a text,
use the br element.

<p> Element

The <p> element defines a paragraph.

 
<p>This is a paragraph 1.</p> <p>This is a paragraph 2.</p> <p>This is a paragraph 3.</p>
 

Here is the result of this code:

This is a paragraph 1.

This is a paragraph 2.

This is a paragraph 3.

<div> Element

The <div> element defines a division or a section in an HTML document.


<div>This is a First Line.</div> <div>This is a Second Line.</div>
 

Here is the result of this code:

This is a First Line.
This is a Second Line.

<span> Element

The HTML <span> element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes.


<p>
My mother has <span style="color:blue;font-weight:bold">blue</span>
eyes and my father has
<span style="color:darkolivegreen;font-weight:bold">darkgreen</span> eyes.
</p>
 

Here is the result of this code:

My mother has blue eyes and my father has darkgreen eyes.

<em> Element

The HTML <em> element marks text that has stress emphasis.


<em>Emphasized text</em>
 

Here is the result of this code:

Emphasized text

<dfn> Element

The HTML <dfn> element represents the defining instance of a term.


<dfn>Definition term</dfn>
 

Here is the result of this code:

Definition term

<samp> Element

The HTML <samp> element is an element intended to identify sample output from a computer program.


<samp>Sample output from a computer program.</samp>
 

Here is the result of this code:

Sample output from a computer program.

<kbd> Element

The HTML <kbd> Element represents user input and produces an inline element.


<kbd>Keyboard input</kbd>
 

Here is the result of this code:

Keyboard input

<code> Element

The HTML <code> Element represents a piece of computer code.

Example:


<code>A piece of computer code</code>
 

Here is the result of this code:

A piece of computer code

<var> Element

The HTML Variable Element (<var>) represents a variable in a mathematical expression or a programming context.


<var>Variable</var>
 

Here is the result of this code:

Variable
;