HTML Basics Guide Pythonista Planet
HTML Basics Guide Pythonista Planet
PYTHONISTA PLANET
1
<html> Tag
<head> Tag
<body> Tag
<html>
<head>
..........................................
</head>
<body>
..........................................
</body>
</html>
HTML files are text files. Hence, you can use any text editor to
create your web page. HTML files should have the extension
.html
<title> Tag
This tag is used for adding a title on the tab describing the
web page. It should be placed in the head section.
<p> Tag
<br> Tag
We use the <br> tag (also called the single line break) to add
a single line of space. <br> is an empty HTML element.
It has no end tag.
Text Formatting
<hr/> Tag
Comments
HTML Elements
<img> Tag
<a> Tag
In HTML, links are defined using the <a> tag. Use the href
attribute to define the destination address of the link.
Lists
An ordered list starts with the <ol> tag and each list item is
defined by <li> tag. The list will be automatically marked
with ordered numbers.
7
An unordered list starts with the <ul> tag. The list items will
be marked with bullets.
<ol>
<li> Red </li>
<li> Blue </li>
<li> Green </li>
</ol>
Output:
1. Red
2. Blue
3. Green
<ul>
<li> Red </li>
<li> Blue </li>
<li> Green </li>
</ul>
Output:
Red
Blue
Green
8
Tables
Tables are defined using the <table> tag. They are divided
into table rows using the <tr> tag. Table rows are further
divided into table data(columns) using the <td> tag.
eg:
<table>
<tr>
<th> Name </th>
<th> Age </th>
</tr>
<tr>
<td> Ashwin </td>
<td> 23 </td>
</tr>
<tr>
<td> Ashish </td>
<td> 17 </td>
</tr>
</table>
Output:
9
A border can be added using the border attribute.
eg:
<table>
<tr>
<td> Red </td>
<td> Blue</td>
<td> Green </td>
</tr>
<tr>
<td> Yellow </td>
<td colspan="2"> Orange </td>
</tr>
</table>
Output:
The <div> (block level) and <span> (inline level) are elements
that are often used as containers for other HTML elements.
Forms
eg:
Output:
eg:
<textarea name= "address" cols="5" rows="10">
</textarea>
Drop-down
eg:
<!DOCTYPE HTML>