Intoduction To HTML
Intoduction To HTML
Dev: HTML
The secret for getting ahead is getting started
<body>
<h1>This is the Body of the Page</h1>
<p>Anything within the body of a web page is
Html body
displayed in the main browser window.</p>
</body>
</html>
A closer look at tags
Attribut Attribut
Element name value
Closing
Tag
Opening Content
Tag
How to create a text?
Earth.</p>
Horizontal lines
<hr>
● Horizontal lines are used to visually break-up sections
of a document.
<p>Venus is the only
planet that rotates
clockwise.</p>
<hr />
<p>Jupiter is bigger than
all the other planets
combined.</p>
Preserve Formatting
<pre>
Sometimes, you want your text to follow the exact format
of how it is written in the HTML document
<html>
<body>
<pre>
We are Computer science
students
</pre>
</body>
</html>
Questions?
LISTS
● There are lots of occasions when we
need to use lists.
● HTML provides us with two main
different types.
ORDERED LISTS
<ol>
The ordered list is created with the <ol> element.
<li>
Each item in the list is placed between an opening <li>
tag and a closing </li> tag.
<ol>
<li>Chop potatoes into quarters</li>
<li>Simmer in salted water for 15-20
minutes until tender</li>
<li>Heat milk, butter and nutmeg</li>
<li>Drain potatoes and mash</li>
<li>Mix in the milk mixture</li>
</ol>
UNORDERED LISTS
<ul>
The unordered list is created with the <ul> element.
<li>
The <table> elements is used to create a table. The contents of the table are written out row by
row.
<tr>
You indicate the start of each row using the opening <tr> tag.(the tr stands for table row)
it is followed by one or more <td> elements (one for each cell in that row). At the end of the
row you use a closing </ tr> tag.
<td>
each cell of a table is represented using a <td> element. (The td stands for table data)
<table>
<tr>
<td>15</td>
<td>15</td>
<td>30</td>
</tr>
<tr>
<td>45</td>
<td>60</td>
<td>45</td>
</tr>
<tr>
<td>60</td>
<td>90</td>
<td>90</td>
</tr>
</table>
Table heading
<th>
The <th> element is used just like the <td> element but its
purpose is to represent the heading for either a column
or a row. For example:
Long tables
<thead>, <tbody>, <tfoot>
<form>
<p>Username:
<input type="text" />
</p>
<p>Password:
<input type="password" />
</p>
</form>
Text area
<textarea>
<form>
<p>What did you think of this gig?</p>
<textarea name="comments" cols="20"
rows="4">Enter your
comments...</textarea>
</form>
Radio button
<input> type=”radio”
<form>
<p>Please select your favorite genre:
<br />
<input type="radio" checked="checked" name=”music” value=”Rock” /> Rock
<input type="radio" name=”music” value=”Pop” /> Pop
<input type="radio"
name=”music” value=”Jazz” /> Jazz
</p>
</form>
Checkbox
<input> type=”checkbox”
<form >
<p>Please select your favorite music service(s):
<br />
<input type="checkbox" checked="checked" name=”service” value=”itunes”/>
iTunes
<input type="checkbox" name=”service” value=”lastfm”/> Last.fm
<input type="checkbox" name=”service” value=”Spotify”/> Spotify
</p>
</form>
Drop down list box
<select> & <option>
<form>
<p>What device do you listen to music on?</p>
<select name=”devices”>
<option value="ipod">iPod</option>
<option value="radio">Radio</option>
<option value="computer">Computer</option>
</select>
</form>
Questions?
@khawla allak
@kawtar khallouq
@khawla allak
@kawtar khallouq