Web Lecture 3
Web Lecture 3
Lecture#03
Today’s Agenda
Comment Tag
Blockquote Tag
Colors in HTML
Table Tag
Lists in HTML
Image Tag
Comments In HTML
Comment tags <!-- and --> are used to insert
comments in HTML.
You can add comments to your HTML source by
using the following syntax:
To make a cell span more than one column, use colspan attribute:
<table style="width:100%">
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>555 77 854</td>
<td>555 77 855</td>
</tr>
</table>
Table Cells that Span Many Rows
To make a cell span more than one row, use the rowspan attribute:
<table style="width:100%">
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th rowspan="2">Telephone:</th>
<td>555 77 854</td>
</tr>
<tr>
<td>555 77 855</td>
</tr>
</table>
An HTML Table With a Caption
• <table style="width:30%">
<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>
Cellpadding & Cellspacing
The cellspacing attribute specifies the space, in
pixels, between cells.
The cellpadding attribute specifies the space, in
pixels, between the cell wall and the cell content.
Unordered HTML Lists
Style Description
list-style-type:disc The list items will be marked with
bullets (default)
Type Description
type="1" The list items will be numbered
with numbers (default)
type="A" The list items will be numbered
with uppercase letters
type="a" The list items will be numbered
with lowercase letters
type="I" The list items will be numbered
with uppercase roman numbers
type="i" The list items will be numbered
with lowercase roman numbers
Nested HTML Lists
Example
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
HTML Description Lists
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
HTML Image
In HTML, images are defined with the <img> tag.
The <img> tag contains attributes , and does not have a
closing tag.
The src attribute specifies the address of the image:
<img src="url" alt="some_text">
The alt attribute specifies an alternate text for an image, if the
image cannot be displayed.
Image Size - Width and Height
You can use the style attribute to specify the width and
height of an image.
The values are specified in pixels (use px after the value):
<img src="html5.gif" alt="HTML5 Icon"
style="width:128px;height:128px;">
Alternatively, you can use width and height attributes. Here,
the values are specified in pixels by default:
<img src="html5.gif" alt="HTML5 Icon"
width="128" height="128">
Images in Another Folder
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:
<h1> - <h6>
<p>
<div>
<form>
The <div> Element