HTML Comments Comments can be inserted into the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed.
Comments are written like this:
Example <!-- This is a comment -->
Comments are written like this:
Example <!-- This is a comment -->
HTML Headings HTML headings are defined with the <h1> to <h6> tags.
Example
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
Try it yourself »
HTML Paragraphs HTML paragraphs are defined with the <p> tag.
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Try it yourself »
HTML Links HTML links are defined with the <a> tag
Example
<a href="http://www.remoambi.weebly.com">This is a link</a>
HTML Images HTML images are defined with the <img> tag.
Example
<img src="WWW.REMOAMBI.WEELY.COM.jpg" width="104" height="142" />
HTML Lines The <hr /> tag creates a horizontal line in an HTML page.
The hr element can be used to separate content:
Example
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
Try it yourself »
The example below shows how the HTML could look by using the <font> tag:
Example
<p>
<font size="5" face="arial" color="red">
This paragraph is in Arial, size 5, and in red text color.
</font>
</p>
<p>
<font size="3" face="verdana" color="blue">
This paragraph is in Verdana, size 3, and in blue text color.
</font>
</p>
HTML Style Example - Background Color The background-color property defines the background color for an element:
Example
html>
<body >
<h2 >This is a heading</h2>
<p >This is a paragraph.</p>
</body>
</html>
TML Style Example - Font, Color and Size The font-family, color, and font-size properties defines the font, color, and size of the text in an element:
Example
<html>
<body>
<h1 >A heading</h1>
<p >A paragraph.</p>
</body>
</html>
Try it yourself » The font-family, color, and font-size properties make the old <font> tag obsolete.
HTML Style Example - Text Alignment The text-align property specifies the horizontal alignment of text in an element:
Example
<html>
<body>
<h1 >Center-aligned heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Deprecated Tags and Attributes In HTML 4, several tags and attributes were deprecated. Deprecated means that they will not be supported in future versions of HTML.
The message is clear: Avoid using deprecated tags and attributes!
These tags and attributes should be avoided:
Tags Description <center> Deprecated. Defines centered content <font> and <basefont> Deprecated. Defines HTML fonts <s> and <strike> Deprecated. Defines strikethrough text <u> Deprecated. Defines underlined text Attributes Description align Deprecated. Defines the alignment of text bgcolor Deprecated. Defines the background color color Deprecated. Defines the text color
Example
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
Try it yourself »
HTML Paragraphs HTML paragraphs are defined with the <p> tag.
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Try it yourself »
HTML Links HTML links are defined with the <a> tag
Example
<a href="http://www.remoambi.weebly.com">This is a link</a>
HTML Images HTML images are defined with the <img> tag.
Example
<img src="WWW.REMOAMBI.WEELY.COM.jpg" width="104" height="142" />
HTML Lines The <hr /> tag creates a horizontal line in an HTML page.
The hr element can be used to separate content:
Example
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
Try it yourself »
The example below shows how the HTML could look by using the <font> tag:
Example
<p>
<font size="5" face="arial" color="red">
This paragraph is in Arial, size 5, and in red text color.
</font>
</p>
<p>
<font size="3" face="verdana" color="blue">
This paragraph is in Verdana, size 3, and in blue text color.
</font>
</p>
HTML Style Example - Background Color The background-color property defines the background color for an element:
Example
html>
<body >
<h2 >This is a heading</h2>
<p >This is a paragraph.</p>
</body>
</html>
TML Style Example - Font, Color and Size The font-family, color, and font-size properties defines the font, color, and size of the text in an element:
Example
<html>
<body>
<h1 >A heading</h1>
<p >A paragraph.</p>
</body>
</html>
Try it yourself » The font-family, color, and font-size properties make the old <font> tag obsolete.
HTML Style Example - Text Alignment The text-align property specifies the horizontal alignment of text in an element:
Example
<html>
<body>
<h1 >Center-aligned heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Deprecated Tags and Attributes In HTML 4, several tags and attributes were deprecated. Deprecated means that they will not be supported in future versions of HTML.
The message is clear: Avoid using deprecated tags and attributes!
These tags and attributes should be avoided:
Tags Description <center> Deprecated. Defines centered content <font> and <basefont> Deprecated. Defines HTML fonts <s> and <strike> Deprecated. Defines strikethrough text <u> Deprecated. Defines underlined text Attributes Description align Deprecated. Defines the alignment of text bgcolor Deprecated. Defines the background color color Deprecated. Defines the text color