Professional Documents
Culture Documents
Introduction
Contents
Introduction to HTML
Overview of CSS
Introduction to HTML
What is HTML?
HTML (Hypertext Markup Language) used for describing
web pages and display its files (text, or multimedia).
HTML is not a programming language, is a markup
language
Cannot be used to describe computations.
Use to describe the general form and layout of documents
to be displayed by the browser.
Tags describe contents of the document
HTML documents contain HTML tags and plain text
Telling the browser what to do, and what props to use.
A series of tags that are integrated into a text document.
HTML Elements/ Tags
HTML commands or tags are enclosed in angled brackets: <
>.
Some tags stand alone and some come in pairs. In paired
tags the ending tag starts with a slash: /.
<p align=“right”> </p>
Not case-sensitive.
Cont’d
Link Tags – Hyperlinks are what the web is all about.
<A> </A> Create Link to another document
HREF = URL URL of document to be linked
text Text to be clicked, usually in blue
enctype You can use the enctype attribute to specify how the browser
encodes the data before it sends it to the server. Possible values
are:
application/x-www-form-urlencoded - This is the standard
method most forms use in simple scenarios.
mutlipart/form-data - This is used when you want to upload
binary data in the form of files like image, word file etc.
HTML Form Controls
There are different types of form controls that you
can use to collect data using HTML form:
Text Input Controls
Checkboxes Controls
Radio Box Controls
Select Box Controls
File Select boxes
Hidden Controls
Clickable Buttons
Submit and Reset Button
Cont’d
Exercise
Create an HTML page which displays student registration
screen with
– a name field
– an ID field
– a department field {select box with values:
1. Computer Science
2. Information Technology
– a semester field {select box with values:
1. I
2. II
– an academic year field {select box with values: 1998-2000, 2000 default}
– a button to submit the form
– a button to reset the form
HTML Table
HTML table – an element comprised of table rows
and columns: these specify cells of the table
Cells can contain text, images, links, other tables...
Purpose: to house other HTML elements and
arrange them in a tabular fashion -- row by row,
column by column.
Table element consists of three different HTML tags
including
<table> tag,
<tr> (table rows), and
<td> (table columns) tags
Cont’d
Table rows and table columns
Table can contain an infinite number of table rows
Each table row is essentially a table element itself, with an
opening and closing tag (<tr> </tr>)
Table columns are also considered child elements of HTML
tables, and like table rows, an HTML table may contain an
infinite number of table data cells (<td> <td>)
Cont’d
<table border="1">
<tr>
<th>Name</th>
<th>Course</th>
<th>Year</th>
</tr>
<tr>
<td>Alemayehu Bekele</td>
<td>Internet Programming</td>
<td>3</td>
</tr>
<tr>
<td>Helen Getahun</td>
<td>computer Network</td>
<td>2</td>
</tr>
<tr>
</table>
Overview of Cascading Style
Sheets (CSS)
Cascading Style Sheets (CSS)
An extension (addition) to HTML which allows us to
style our web pages
Provides more detailed attributes to elements than the
ones defined in standard HTML
Styles are defined once and used any number of times
and in several contexts
Clearly separates content from its presentation
Saves a lot of work - especially in website
maintenance and upgrading
Cont’d
What is CSS – Cascading Style Sheet?
style language that defines layout of HTML documents
supported by all browsers today.
Difference between CSS and HTML
HTML
designed to specify the content and structure of web pages
CSS
CSS defines HOW HTML elements are to be displayed
(formatting structured content)
used to specify the presentation, or styling, of elements on a
web page (e.g., fonts, spacing, sizes, colors, positioning).
style portable web pages independently of their content &
structure
c)
{ Declaring variables is
optional. Type is
var total; never declared.
total = a+b+c;
return total/3; Value returned here.
}
Form validation
<script type = "text/javascript">
<!--
// Form validation code will come here.
function validate() {