Introduction To Web Design and Applications: Lecture 4 A

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 54

Introduction to Web Design

and Applications
APT 1040
LECTURE 4 A

By Bernard Ondiek
[email protected]

Intro to Web Design and Apllication 1


LISTS

 ORDERED
 UNORDERED

Intro to Web Design and Apllication 2


HTML – Fundamentals
Lists

Unordered
Ordered listlist

II. apples
 apples
III.bananas
 bananas
IV.grapes
 grapes
V. strawberries
 strawberries

Intro to Web Design and Apllication 3


Ordered list

Ordered list

<ol type=‘i’ start=‘2’>


<li>apples</li>
<li>bananas</li>
<li>grapes</li>
<li>strawberries</li>
</ol>
Intro to Web Design and Apllication 4
LAB1: Ordered Lists

<html>
<head>
<title>orderd lists</title>
</head>
<body bgcolor=“lavender”>
<H1><center>ordered list</center></H1>
<ol type=‘i’ start=‘2’>
<li>apples</li>
<li>bananas</li>
<li>grapes</li>
<li>strawberries</li>
</ol>
</body>
</html>
Intro to Web Design and Apllication 5
Now…..
Tweek the webpage to display

 1,2,3
 A,B,C
 I, II,III
 a,b,c

Intro to Web Design and Apllication 6


Unordered list

Unordered list

<ul>
<li>apples</li>
<li>bananas</li>
<li>grapes</li>
<li>strawberries</li>
</ul>

Intro to Web Design and Apllication 7


LAB2: unordered List
<html>
<head>
<title>unorderd lists</title>
</head>
<body bgcolor=“lavender”>
<H1><center>ordered list</center></H1>
<Ul type=‘*’>
<li>apples</li>
<li>bananas</li>
<li>grapes</li>
<li>strawberries</li>
</Ul>
</body>
</html>

Intro to Web Design and Apllication 8


Question
 What is displayed??

Try
 Circle
 Disc
 Square

Intro to Web Design and Apllication 9


Test your skills…………….
CITIES IN AFRICA
1.KENYA
• NAIROBI
• MOMBASA
• KISUMU
2. NIGERIA
 PORT HARCOURT
 ABUJA
 LAGOS

3.TANZANIA
o ARUSHA
o DAR
o DODOMA

4. UGANDA
A. KAMPALA
B. ENTEBBE
C. MBARARA

Intro to Web Design and Apllication 10


HTML – Fundamentals
Tables
<TABLE BORDER=“1”>
<TR>
<TH>Student</TH>
<TH>Grade</TH>
</TR>
<TR>
<TD>Tom</TD>
<TD>B+</TD>
</TR>
<TR>
<TD>Sue</TD>
<TD>A-</TD>
</TR>
</TABLE>
Intro to Web Design and Apllication 11
HTML – Fundamentals
Tables

Intro to Web Design and Apllication 12


HTML – Fundamentals
Tables

 BORDER=value

 ALIGN=left|right|center

 CELLSPACING=value

 CELLPADDING=value

 WIDTH=value|percent

Intro to Web Design and Apllication 13


HTML – Fundamentals
Tables
<TABLE BORDER=1 WIDTH=“50%" CELLPADDING=“6” CELLSPACING=“2”
ALIGN="RIGHT">
<CAPTION ALIGN="bottom">Class Grades</CAPTION>
<TR>
<TH>Student</TH>
<TH>Grade</TH>
</TR>
<TR>
<TD>Tom</TD>
<TD>B+</TD>
</TR>
<TR>
<TD>Sue</TD>
<TD>A-</TD>
</TR>
</TABLE>
Intro to Web Design and Apllication 14
HTML – Fundamentals
Tables

Student Grade

Tom B-

Sue A+

Class
Grades

Intro to Web Design and Apllication


15
Table structures

<TABLE>...</TABLE> The Table delimiter.

<TR ...>...</TR> Used to specify number of


rows in a table.
<TD ...>...</TD> Specifies table data cells.

<TH ...>...</TH> Table Header cell.

<CAPTION Specifies the table Caption.


...>...</CAPTION>

Intro to Web Design and Apllication

16
HTML – Fundamentals
Tables

rowspan and colspan

Intro to Web Design and Apllication


17
HTML Comments

 Comments are usually added with the purpose of


making the source code easier to understand.
 It may help other developer (or you in the future when
you edit the source code) to understand what you were
trying to do with the HTML. Comments are significant to
programmers but typically ignored by browsers.

Intro to Web Design and Apllication 18


HTML Comments

 An HTML comment begins with <!--, and ends with -->,


See the example next slide:

Intro to Web Design and Apllication 19


HTML – Fundamentals
<TABLE BORDER=1 WIDTH="50%" CELLPADDING=5 ALIGN="center">
<TR>
<TD colspan=2 align='center'>
<font color="red"><b>Student Grades</b></font>
</TD>
</TR>
<TR>
<TD><b>Student</b></TD>
<TD><b>Grade</b></TD>
</TR>
<TR>
<TD>Tom</TD>
<TD rowspan=2>A</TD>
</TR>
<TR>
<TD>Sue</TD>
</TR>
Intro to Web Design and Apllication
</TABLE> 20
HTML – Fundamentals

Student Grades
Student Grade
Tom
A
Sue

Intro to Web Design and Apllication


21
Screen Compatibility
1280 x 1024

1024 x 768

800 x 600

640 x 480

Intro to Web Design and Apllication 22


HTML – Fundamentals
Tables

 Tables are frequently used to layout the basic web page design.
1280

Intro to Web Design and Apllication


64 23
HTML – Fundamentals
Frames

 Basic Frames
 Floating Frames (inline frames)
 Picture in picture

 Frames let you divide a screen into windows with each


window viewing a different web page.

Intro to Web Design and Apllication 24


HTML – Fundamentals
Basic Frames

Banner

Menu Content

Footer

Intro to Web Design and Apllication


25
HTML – Fundamentals
Basic Frames

Basic tags
 <frameset> ..</frameset>
 <frame />
 <noframes> .. </noframes>

Basic attributes
 cols = “values”
 rows = “values”
 name = “frame_name”
 src = “frame_source(url)”
 target = “frame_name”

Intro to Web Design and Apllication 26


HTML – Fundamentals
Basic Frames

Banner

Menu Content

Footer

Intro to Web Design and Apllication


27
HTML – Fundamentals
Basic Frames

<frameset rows=“80,*,80”>
<frame src=“banner.html” />
<frameset cols = “25%,75%” >
<frame src=“menu.html” />
<frame src=“content.html” />
</frameset>
<frame src=“footer.html” />
</frameset>

Intro to Web Design and Apllication 28


HTML – Fundamentals
Basic Frames
<frameset rows=“80,*,80”>
<frame src=“banner.html” />
<frameset cols = “25%,75%” >
<frame src=“menu.html” />
<frame src=“content.html” />
</frameset>
<frame src=“footer.html” />
<noframes>
<body>
Welcome to my page.
<A HREF="noframes.htm">Continue</A>
to the frame-free version.
</body>
</noframes>
</frameset>
Intro to Web Design and Apllication 29
HTML – Fundamentals
Basic Frames

FRAMESET attributes

 FRAMEBORDER="yes|no"|0
 BORDER=pixels
 BORDERCOLOR="#hexcolor|colorname"

< frameset rows="80,*,80" border=2


bordercolor=“red" >
..
..
</frameset>
Intro to Web Design and Apllication 30
HTML – Fundamentals
Basic Frames
Individual FRAME attributes

 SCROLLING="yes|no|auto"
 NORESIZE
 MARGINWIDTH=pixels
 MARGINHEIGHT="pixels"
 BORDERCOLOR="color"
 FRAMESPACING="pixels"
 FRAMEBORDER="yes|no"|0
NAME=“frame_name”
Intro to Web Design and Apllication 31
HTML – Fundamentals
Floating Frames

 Floating frames allow you to create a frame within the


boundaries of a page

Basic Floating
Frames Frames
Intro to Web Design and Apllication 32
HTML – Fundamentals
Floating Frames

<IFRAME attributes ></IFRAME>

Attributes
 SRC=URL
 HEIGHT=pixels|percent,
 WIDTH=pixels|percent
 HSPACE=pixels
 VSPACE=pixels
 ALIGN=left|right
 FRAMEBORDER=0
Intro to Web Design and Apllication 33
HTML – Fundamentals
Floating Frames

<IFRAME
NAME=“frame_name”
ALIGN="right"
HSPACE=“40”
VSPACE=“40”
WIDTH="75%"
HEIGHT=“150”
FRAMEBORDER=0
SRC=http://www.mysite/mypage.htm >
</IFRAME>
Intro to Web Design and Apllication 34
HTML – Fundamentals
Hypertext links

<a href=“page.html” target=“blank” >Click this link


</a>
 Creates new window for the page

<a href=“page.html” target=“parent” >Click this link


</a>
 Opens page in the parent frame/wind of this frame/window

<a href=“page.html” target=“top” >Click this link </a>


 Opens page in top most frame/window

Intro to Web Design and Apllication 35


HTML – Fundamentals
DIV and ILAYER

 Allows you create a position-able block of content.

Content
position
ed
within
this
Intro to Web Design and Apllication 36
block
HTML – Fundamentals
DIV

<div attributes> content </div>

attributes
 ID=“name”
 STYLE = “style parameters re: CSS”

Intro to Web Design and Apllication 37


HTML – Fundamentals
DIV
< DIV ID=“fred”
STYLE = “POSITION:absolute|relative;
VISIBILITY:visible:hidden;
Z-INDEX:number;
WIDTH:width in pixels;
HEIGHT:height in pixels;
TOP:pixels from top of page or block;
LEFT:pixels from left edge of page or block;
PADDING:margin in pixels;
other style attributes; “ >

content
</DIV>
Intro to Web Design and Apllication 38
HTML – Fundamentals
DIV

content

content
contentc
content content

content
content

Intro to Web Design and Apllication 39


HTML – Fundamentals
DIV

<div style="position:absolute; left:100px; top:100px;


width:100px; height:100px; background-color:#ffffff;
">

Intro to Web Design and Apllication 40


HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)

 Styles enable you to define a consistent 'look'


for your documents by describing once how
headings, paragraphs, quotes, etc. should be
displayed.

 Style sheet syntax is made up of three parts:

selector {property: value}


selector = element.class
Intro to Web Design and Apllication 41
HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)
H1 {text-align: center; color: blue}

A {color:green; font-familiy:arial,courier; font-weight:bold;}

td { align:center; background-color:grey; border-color:red;}

div {position:absolute; visibily:hidden; margin:10px }

font {color:navy; font-size:2pt; font-face:trebuchet; }

hr {color:#ff0000; width:80%; align:center; }

table {width:80%; align:center; border:2px; padding:5px; }


Intro to Web Design and Apllication 42
HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)

H1 {text-align: center; color: blue}


H1.widget {text-align: center; color: red; font-size:80%; }

A {color:green; font-familiy:arial,courier; font-weight:bold;}


A.menu {color:cyan; font-familiy:arial,courier; font-style:italics;}

td { align:center; background-color:grey; border-color:red;}


td.figure { align:right; background-color:white; border-color:black;}

font {color:navy; font-size:2pt; font-face:trebuchet; }


font.fred {color:blue; font-size:2pt; font-face:trebuchet; font-weight:bold; }

element.class {property:value; }
Intro to Web Design and Apllication 43
HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)
Embedded

<head>
<title> My Page Title </title>

<style TYPE="text/css >


<! - -
element.class { property:value; }
element.class { property:value; }
-->
</style>
</head>
Intro to Web Design and Apllication 44
HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)
Linked
Styles can be defined in a separate file

<font style=“property:value; “> text </font>


<font class=“fred”> text </font>

mystyles.css

<head>
<LINK REL="stylesheet" HREF="mystyles.css“ TYPE="text/css">
</head>
Intro to Web Design and Apllication 45
HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)

/* Example style sheet file (note how this comment was created) */

BODY {background: #FFFFD8; margin-top: 20}

A:link {color: #400080; background: #FFFFD8}

H1 {font-weight: bold; text-align: center; color: #006000;


background: #FFFFD8; font-family: Gill Sans, Arial, sans-serif; }

font.caption {font-family: Gill Sans, Arial, sans-serif; font-style:


italic; }

/* End of example style sheet file */

Intro to Web Design and Apllication 46


HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)
Inline

Styles can be placed within individual


elements

<font style=“color:red; font-face:ariel;” >

Intro to Web Design and Apllication 47


HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)

Inline > Embedded > Linked

Defining the style of your text


 linked -> font-family:arial,georgia;
 embedded -> color:navy;
 inline -> font-size:2pt;

Intro to Web Design and Apllication 48


HTML – Fundamentals
CASCADING STYLE SHEETS (CSS)

Using IDs

 IDs enable you to define a unique style which you can apply to a
number of elements.

<STYLE>
<!–
#copyright {font-style:italic; font-size:smaller; }
-->
</STYLE>

<p ID=“copyright”> Any textual content </p>


Intro to Web Design and Apllication 49
HTML – Fundamentals
Images

<img src=“images/pic1.jpg” width=75px,


height=50px />

<img class=“pics” src=“images/pic1.jpg” />

img.pics { width:75px; height:50px; border-


width:3px }

Intro to Web Design and Apllication 50


HTML – Fundamentals
Using Images

 Images take longer to download than text


 The larger the image, the slower the page
 Use optimization software
 Use thumb nail images

Intro to Web Design and Apllication 51


HTML – Fundamentals
Other uses of Images

 Page background (not recommended)


 <body background-image = “url” >
 <body class=“background”>
 body.background { background-image:$url; }
 Table background
 <table background-image=“url”>
 <table class=“background”>
 table.background { backlground-image:url; }
 DIV background
 <div style={ background-image:url; } >
Intro to Web Design and Apllication 52
Resources
http://www.w3schools.com/
 HTML Tutorials  XML Tutorials  .NET (dotnet)
Learn HTML Learn XML .NET Microsoft
Learn XHTML Learn XSL .NET ASP
Learn CSS Learn XSLT .NET Mobile
Learn TCP/IP Learn XSL-FO
Learn XPath
Learn XQuery  Multimedia
 Browser Scripting Learn XLink Learn Media
Learn JavaScript Learn XPointer Learn SMIL
Learn DHTML Learn DTD Learn SVG
Learn VBScript Learn Schema Learn Flash
Learn HTML DOM Learn XML DOM
Learn WMLScript Learn XForms  Web Building
Learn SOAP Web Building
 Server Scripting Learn WSDL
Learn RDF Web W3C
Learn SQL Web Browsers
Learn ASP Learn RSS
Learn ADO Learn WAP Web Quality
Learn PHP Web Semantic
Web Careers
Web Hosting
Web Certification
Intro to Web Design and Apllication 53
Q&A

Intro to Web Design and Apllication 54

You might also like