Ex: Ex:: HTML Comment Tags
Ex: Ex:: HTML Comment Tags
iq
Defines emphasized
<em> <p><em>This text is emphasized</em></p>
text
Defines important
<strong> <p><strong>This text is strong</strong></p>
text
Defines subscripted
<sub> <p>This is <sub>subscripted</sub> text.</p>
text
Defines
<sup> <p>This is <sup>superscripted</sup> text.</p>
superscripted text
Defines inserted
<ins> <p>My favorite <ins>color</ins> is red.</p>
text
Defines
<mark> marked/highlighted <h2>HTML <mark>Marked</mark> Formatting</h2>
text
Instructor: Sudad H. Abed / Email: [email protected]
❖ HTML Colors:
• Background Color:
Ex: <h1 style ="background-color:Tomato;">Hello World</h1>
Ex: <p style ="background-color: #00f3f7;">I like HTML.</p>
• Text Color:
Ex: <h1 style="color:Tomato;">Hello World</h1>
• Border Color:
Ex: <h1 style="border:2px solid green;">Hello World</h1>
❖ HTML Lists:
• Unordered HTML List:
Ex:
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Ex:
<ul style="list-style-type:square">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Instructor: Sudad H. Abed / Email: [email protected]
❖ HTML Tables:
• Adding a Border:
- If you want to add border to the table you need to add the style code below
inside the <head> tag.
<style>
table, th, td {
border: 1px solid black;
}
</style>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
<table>
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>
Instructor: Sudad H. Abed / Email: [email protected]
Ex:
<table>
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>55577854</td>
<td>55577855</td>
</tr>
</table>
Ex:
<table>
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th rowspan="2">Telephone:</th>
<td>55577854</td>
</tr>
<tr>
<td>55577855</td>
</tr>
</table>
Instructor: Sudad H. Abed / Email: [email protected]
• Block-level Elements:
A block-level element always starts on a new line and takes up the full width
available (stretches out to the left and right as far as it can).
- Examples of block-level elements:
➢ <div>
➢ <h1> - <h6>
➢ <p>
➢ <form>
• Inline Elements:
An inline element does not start on a new line and only takes up as much
width as necessary.
- Examples of inline elements:
➢ <span>
➢ <a>
➢ <img>
Ex:
<div style="background-color:black;color:white;padding:20px;">
<h2>London</h2>
<p>London is the capital city of England. It is the most
populous city in the United Kingdom, with a metropolitan area of
over 13 million inhabitants.</p>
</div>