HTML
HTML
Front-end languages:
Front-End Frameworks and Libraries
HTML
HTML stands for Hyper Text Markup Language
Unpaired Tags: An unpaired tag does not have a companion tag .unpaired tags
are also known as singular or Stand-Alone tags. e.g. <br>,<hr>, etc.
HTML TERMINOLOGY
Attribute:
The attribute is the property of a tag that is specified in the opening angle brackets. It
supplies additional information like color, size, home font style, etc to the browser about a
tag. E.g. most of the common attributes are height, color, width, src, border, align, etc.
Element:
</html>
Displaying bold, italic, or underlined text
<html>
<body>
<b>Here is some bold text</b>
<br />
<i>Here is some italic text</i>
<br />
<u>Here is some underlined text</u><br />
<br />
<b><u><i> Here is some bold, italic, and underlined text </i></u></b>
</body>
</html>
Displaying text in different sizes using headings
<html>
<body>
<h6>Headings</h6>
<h5>come in</h5>
<h4>a few different sizes</h4>
<h3>Use them</h3>
<h2>for page</h2>
<h1>organization</h1>
</body>
</html>
Displaying text in different fonts, sizes, and colors
<html>
<body>
<font color="green">
The font element is deprecated in HTML 4 and CSS should be used instead.
</font>
<font size="6">
Although deprecated, the font element is not obsolete, it can still be used.
</font>
<font face="Courier">
The font element can be used for backward compatibility -
</font>
</body>
</html>
Deleting and inserting text
<html>
<body>
HTML stands for
<del>Hyper Translation Markup Language</del>
<ins>Hyper Text Markup Language</ins>.
</body>
</html>
Creating ordered lists
<html>
<body> <b>An ordered list with uppercase roman numerals:</b>
<b>An ordered list with numbers (default):</b> <ol type="I">
<ol> <li>Telephone</li>
<li>Telephone</li> <li>Cellular phone</li>
<li>Cellular phone</li> <li>Television</li>
<li>Television</li> <li>Fax machine</li>
<li>Fax machine</li> </ol>
</ol> </body>
</html>
<b>An ordered list with lowercase letters:</b>
<ol type="a">
<li>Telephone</li>
<li>Cellular phone</li>
<li>Television</li>
<li>Fax machine</li>
</ol>
Creating unordered lists
<html>
<body>
<b>An unordered list with disc bullets (default):</b>
<ul type="disc">
<li>Telephone</li>
<li>Cellular phone</li>
</ul>
<b>An unordered list with square bullets:</b>
<ul type="square">
<li>Telephone</li>
<li>Fax machine</li>
</ul>
<b>An unordered list with circle bullets:</b>
<ul type="circle">
<li>Cellular phone</li>
<li>Television</li>
</ul>
</body>
</html>
Description lists
<html>
<body>
<b>A description list:</b>
<dl>
<dt>HTML</dt>
<dd>Stands for Hyper Text Markup Language. It is used to create webpages.</dd>
<dt>Guitar</dt>
<dd>A stringed musical instrument.</dd>
</dl>
</body>
</html>
Creating nested lists
<html>
<body>
<b>An unordered nested list:</b> <b>An ordered nested list:</b>
<li>Vehicle types:
<ul> <!-- second nested list begins here -->
<li>Book genres: <ol type="A">
<!-- first nested list begins here --> <li>Car</li>
<ul> <li>Van</li>
<li>Fiction</li> <li>Truck</li>
<li>Non-Fiction</li> <li>Trailor</li>
<li>Adventure</li> </ol>
<li>Educational</li> <!-- second nested list ends here -->
</ul> </li>
<!-- first nested list ends here --> </ol>
</li> </body>
</html>
Displaying preformatted text
<html>
<body>
<b>A sample Java program:</b>
<pre>
class DataClass{
public static void main(String[] args){
System.out.println("Here is some text.");
}
}
</pre>
<p>
Using the pre-element you can display text however you want with all the
spaces and line breaks preserved.
</p>
</body>
</html>
Displaying quotations and subscript or superscript
<html>
<body>
<blockquote>
In 1983, usability was an oppressed discipline. We few pioneers had to
struggle against the prevailing attitude that computing is about power and
features — not ease of use and a pleasurable user experience.
</blockquote>
<q>Hello, I am a quote. A short one.</q>
H<sub>2</sub>O = Water
<br />
75<sup>th</sup>
</body>
</html>
Linking to other websites and directories
<html>
<body>
<a href="http://www.yahoo.com">Go to Yahoo</a>
<br /><br />
<a href="http://www.reddit.com">Go to Reddit</a>
<p>
Linking to a page in a directory ahead of the current
directory. You can do it by using the name of the directory
and the file name as a relative path:
</p>
<a href="file.txt">See some text</a>
</body>
</html>
Linking within the same page
<html>
<body>
<a name="top"></a>
Click <a href="#bottom">here</a> to jump to the bottom of the page
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<a name="bottom"></a>
Click <a href="#top">here</a> to jump to the top of the page
</body>
</html>
Basic HTML table
<html>
<body>
<table border="2">
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</table>
<p> About as basic as it gets, really. </p>
</body>
</html>
Table row span and column span
<html> <p>
<body> Spanning more than one row:
<p> </p>
Spanning more than one column: <table border="2">
</p> <tr>
<table border="2"> <td>Cell 1</td>
<tr> <td>Cell 2</td>
<td>Cell 1</td> </tr>
<td colspan="5">Cell 2</td> <tr>
</tr> <td rowspan="2">Cell 3</td>
<tr> <td>Cell 4</td>
<td>Cell 3</td> </tr>
<td>Cell 4</td> <tr>
</tr> <td>Cell 5</td>
</table> </tr>
</table>
</body>
</html>
Queries