Unit 1
Unit 1
Learning objectives
Basics of HTML/CSS
Fundamentals of Web Graphics
Web Page Design Principles
Building a simple website
Image maps
Adding multimedia to a website
Introduction
Every HTML program should have the <html> as start tag and
</html> as end tag
HTML tags normally come in pairs like <b> and </b>. The first
tag in a pair is the start tag, the second tag is the end tag.
The text between the start and end tags is the element content.
HTML tags are not case sensitive
The <head> tag is used to store some meta information about the
program.
The content of the <title> tag is displayed in the tile bar of the
browser window.
The purpose of the <body> tag is to define the HTML element that
contains the body of the HTML document. The content inside the
<body> </body> is what is displayed in the browser.
HTML/CSS
Text formatting using basic tags
<html> <br>
<body bgcolor="yellow"> <i>
<b>This text is bold</b> This text is italic
<br> </i>
<p align="center"> hi how are you</p> <br>
<br> This text contains
<pre> How you write and where <sub>
are subscript
preserved.</pre> </sub>
<br> <br>
<p> <font face="arial" color="blue"> This text contains
helloworld</font></p> <sup>
<br> superscript
<p><blockquote> Its raining heavily get an </sup>
umbrella<blockquote></p></blockquote> </body>
<br> </html>
<!..this is commented text that will not be
displayed..>
<h1>
This text is big
</h1>
HTML/CSS
Text formatting using basic tags:
HTML/CSS
Formatting using Lists:
Lists.html
<html>
<body>
<h4>An Unordered
List:</h4>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
<h4>An ordered
List:</h4>
<ol>
<li>one</li>
<li>two</li>
<li>three</li>
</ol>
<h4>Definition List:</h4>
<dl>
<dt>Sunday</dt>
<dd>day of sun</dd>
<dt>Tuesday</dt>
<dd>Day of Mars</dd>
</dl>
</body>
</html>
HTML/CSS
Creating Hyperlinks:
Tag Attribute Value description
Ex:
<a href=”http:///www.yahoo.com”>clickme</a>
<a href=”http:///www.yahoo.com”><img src=”clickme.jpg”</img></a>
<a href=” http://www.yahoo.com” target=”_blank”>clickme</a>
<a href=”http://www.chapters.com#chapter1”>click to see chapter 1</a>
If you want to jump to subsection within the ‘same’ document then
use the following statement.
<a href=”#chapter1”>chapter 1</a>
HTML/CSS
Creating Tables:
Tables are defined with the <table> tag. A table is divided into rows
with the <tr> tag, and each row is divided into data cells with the
<td> tag.
<html> <tr>
<body> <th>First
<h4>Cell that spans two Name:</th>
columns:</h4>
<table border="1" <td>Mr.Lenovo</t
cellpadding=”10”> d>
<tr> </tr>
<th>Name</th> <tr>
<th <th
colspan="2">Telephone</th rowspan="2">Telep
> hone:</th>
</tr> <td>555 77
<tr> 854</td>
<td>Mr.Lenovo</td> </tr>
<td>555 77 854</td> <tr>
<td>555 77 855</td> <td>555 77
</tr> 855</td>
</table> </tr>
<h4>Cell that spans two </table>
rows :</h4> </body></html>
<table border="1"
cellspacing=”10”>
HTML/CSS
Creating Frames:
The <frameset> tag defines how to divide the window into frames.
Each frameset defines a set of rows or columns.
You cannot use the <body></body> tags together with
the <frameset></frameset> tags.
Tag Attrib Value description
ute
Ex: p{color:blue;font-family:verdana;font-size:24}
HTML/CSS
Cascaded Style Sheets:
<html>
<head>
<style type="text/css">
p{color:blue;font-family:verdana;font-
size:14}
</style>
</head>
<body>
<p> Here ‘selector’ is any HTML
element or tag and ‘property’ is the
attribute and ‘value’ is the value of the
attribute.
Property and its value are separated
by a colon. If there are more than one
property value pairs they can be
separated with a
semicolon.</p></body>
</html>
HTML/CSS
Cascaded Style Sheets:
Inline stylesheet overrides all other style sheets i.e the hierarchy is
Inline, Internal, and External in that order.
If you want to have an external style sheet, write the style rule
separately in a text editor and save it with the extension .css. To link an
external style sheet to a web page, write the following statement in the
<head> section of the web page.
<link rel=”stylesheet” type=”text/css” href=”one.css”>
HTML/CSS
Cascaded Style Sheets:
The same style rule can be applied to more than one HTML element by
grouping the selectors as below.
Ex: h1,h2,h3,h4{ color:blue;font-family:verdana}
Class selector: If you wish to apply different styles to the same type of
HTML element then class selector can be used.
Ex: p.one{color:blue;font-family:verdana;font-size:24}
p.two{color:yellow;font-family:arial;font-size:14}
<p class=”one”>blablablablabla</p>
<p class=”two”>efghiefghiefghi</p>
Class selector can also be used such that one style rule is applicable to all the
elements that belong to a particular class i.e. by removing the selector itself
as below.
.one { color:yellow;font-family:arial;font-size:14}
HTML/CSS
Cascaded Style Sheets:
ID Selector: You can also define styles for HTML elements with the id
selector. The id selector is defined as #. The style rule below will match
the element that has an id attribute with a value of "green":
#green {color:green}
The style rule below will match the p element that has an id with a value
of "para1":
p#para1{text-align: center;color: red}
HTML/CSS
Cascaded Style Sheets:
CSS Text properties:
attribute Value description
color or hex value or rgb Sets the color of a text
color
value
normal Sets the distance between lines
number
line-height
length
%
normal Increases or decreases the spacing between
letter-spacing
length characters
left Aligns the text in an element
right
text-align
center
justify
length To set all the above background properties at
text-indent
% once
none Controls the letters in an element
text- capitalize
transform uppercase
lower case
normal Increases or decreases the space between words
word-spacing
Basics of web Graphics
The two variants of graphics are raster graphics and
vector graphics. Raster graphics uses pixel information for
representing and displaying the images or graphics, while
vector graphics uses mathematical representations of images.
Raster graphics is resolution dependent while vector graphics is
not. Graphics can be 2D or 3D.
>Graphics file formats and standards - GIF, JPEG, PNG, SVG, and CGM
>Optimizing web graphics
>web graphics software
Bandwidth concerns:
5 1 3
Guide the User’s eye
4
Keep a flat hierarchy
Web Structure
Web Page Design and Site Building
Planning the site:
When you create an image map, you are creating an area that is clickable
on the image.
There are three shapes you can create:
rect - a rectangle or four sided figure
poly - a polygon or multisided figure
circle - a circle
Image maps
<map name="name">
<area shape="rect" coords="0,0,10,15" href="http://abcd.com/">
<area shape="poly" coords="10,0,14,3,7,10" href="http://abcd.com/">
<area shape="circle" coords="20,10,5" href="http://abcd.com/">
</map>
<img src="image" usemap="#name">
Adding Multimedia to a website
<object classid=”clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B”
Width=”150” height = “150”
codebase=”http://www.mywebsite.com/oneactiveX”>
<param name = “src” value=”hi.mov”>