Chapter 2 Upto 4.pptx Static Site Development (HTML & CSS)
Chapter 2 Upto 4.pptx Static Site Development (HTML & CSS)
Chapter 2 Upto 4.pptx Static Site Development (HTML & CSS)
Each web page is a separate document and there are no databases or external files
The only way to edit this type of website is to go into each page and edit the HTML.
Hard for Mobility and Modification, also difficult to host up-to-date information
Visitors to a static Web page all see the same content (unchanged).
Stands for Hyper Text Markup Language and is not a programming language, it is a markup
language
A markup language is a set of markup tags and is a language for describing Web Pages.
Is a set of logical codes (markup) that constitute the appearance of a web document and the
information it contains.
This codes are enclosed by less than “<” and greater than “>” brackets these bracketed code
Most elements have an opening element (tag) and a closing element (tag) Distinguished by
the “/” inside the “<” opening bracket. E.g.<p>this text is paragraph</p>
html codes are not case-sensitive
HTML element
The first word or character that appears inside the “<” opening bracket is Called the element.
An element is a command that tells the browser to do something. e.g. <b>
: - each block-level element begins on new line and space is also usually add above and below the
entire element by default. e.g. header(h1-h5) and paragraph(p)
Inline element:-do not start new line, they just go with flow.
Empty element:-Empty elements are do not have text content
• E.g. image element(img)
• Line break (br)
HTML Attribute
Attributes are another way of describing the element’s properties.
Attribute are instruction that clarify or modify an element.
Attributes appear to the right of an element, separated by a Space, and followed by an equal sign. The value of the
attribute is contained in quotes.
<html>
<head>
<HTML> is the first tag in your HTML document and this tag tells for your browser this is the
</HTML> this tag tells your browser that this is the end of the HTML document.
Inside the BODY element, heading elements H1 through H6 are generally used for major
H1: should be used as the highest level of heading, H2 as the next highest, and so forth.
The size of the text surrounded by a heading element varies from very large in an <H1> tag
ax2+bx+c=0
Subscript Text - The <sub> Element:
The content of a <sub> element is written in subscript;
e.g.<p>H<sub>2</sub>O</p>
This produces the following result
H2O
A style sheet is a series of rules that defines the style for a Web page or an entire Web site.
Style sheets adhere to a common language with set standards and rules. This language, called
Cascading Style Sheets, or CSS, allows a Web developer to write code statements that
control the style of elements on a Web page.
With CSS you can add visual elements such as colors, borders, margins, and font styles to your
Web pages.
CSS is not used to add any content to your Web site; it just makes your content
paragraph. The style changes that specific tag, but does not affect other tags in the
document.
An embedded style sheet, you add the style sheet within the <head> tags of the HTML
lists in HTML
23
There are three basic types of lists in HTML:
i. Unnumbered,
ii. Numbered
iii. Definition.
• Unordered (or Unnumbered) lists are indented lists with a special bullet symbol in front of
each of them.
Apple <UL>
Orange <LI>Apple</LI>
Grapes
<LI>Orange</LI>
o In order to make above list <UL> tag is used in HTML
<LI>Grapes</LI>
</UL>
Web Applications Development Technologies 06/19/2023
Attributes of <UL> (unordered list) tag
24
By default, a solid circle is used for the bullets. However, you can change the bullet style
using type attribute. The attribute may have a value of either disc, circle or square.
<HTML> <UL type=”circle”> <UL>
<HEAD> <LI> One</LI> <LI>SimCity</LI>
<TITLE>Various Bullet <LI>Two </LI> <LI>Quake II</LI>
Styles</TITLE> <LI>Three </LI> <UL>
</HEAD> </UL> <LI>SimCity 3000</LI>
<UL type=”square”> <LI>Quake III</LI>
<BODY> </UL>
<UL> <LI> One</LI>
<LI> One</LI> <LI>Two </LI> <LI>Bridge</LI>
</UL>
<LI>Two </LI> <LI>Three </LI>
<LI>Three </LI> </UL>
</UL> </BODY>
</HTML>
Web Applications Development Technologies 06/19/2023
Numbered Lists or Ordered Lists
25
Ordered ( or Numbered) lists are indented lists that have numbers or letters in front of each
of them.
A numbered list is identical to an unnumbered list, except it uses <OL> instead of <UL>.
The items that are tagged with <LI> appear numbered e.g. 1,2,3 etc. on the browser
Normally, browsers automatically number ordered list items beginning with the Arabic numeral 1.
The start attribute for the <OL> tag lets you change that beginning value. To start numbering a list
at 5, for example, you may write:
<OL start =5>
<LI> This is item number 5.</LI>
<LI> This is item number 6.</LI>
<LI> And so forth…..</LI>
</OL>
By default, browsers number ordered list items with a sequence of Arabic numerals.
Besides being able to start the sequence at some number other than 1, you can use the type
attribute with the <OL> tag to change the numbering style itself.
<HTML>
<HEAD> <H4>Letters list :</H4> <LI>Oranges</LI>
<TITLE>Many Ordered Lists</TITLE> <OL type=”A”> <LI>Peaches</LI>
</HEAD> <LI>Apples</LI> </OL>
<BODY> <LI>Oranges</LI> </BODY>
<H4> Numbered List : </H4> <LI>Peaches</LI> </HTML>
<OL> </OL>
<LI>Apples</LI> <OL type =”a” start= 5>
<LI>Oranges</LI> <LI>Apples</LI>
<LI>Peaches</LI>
</OL>
Definition lists are indented lists without any bullet symbol or any number in front of each
item.
The following is an example of a definition list:
<DL>
<DT> DBU
<DD> Computing college University of DBU.
<DT> University Center
<DD> Ethiopia
</DL>
HTML tables allow you to arrange data into rows and columns of cells.
<HTML>
<HEAD>
Various Table Tags <TITLE>CREATING TABLE</TITLE>
</HEAD>
1. <table> - wraps up a table and its elements. <BODY>
<TABLE>
<CAPTION>A SIMPLE TABLE</CAPTION>
2. <tr> - which defines a table row. <TR>
<TD>ONE</TD>
3. <th> - which defines table header. <TD> TWO</TD>
<TD>THREE </TD>
</TR>
4. <td> - which defines data cells. <TR>
<TD>FOUR </TD>
5. <caption> - which defined title for the table. <TD> FIVE</TD>
<TD> SIX</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Web Applications Development Technologies 06/19/2023
TABLE> tag
30
The table tag begins the process of building a table. Its attributes are:
border BORDER attribute <TR>
bordercolor A table’s border is specified through <TD>Cell Data</TD>
BORDER attribute. <TD>Cell Data</TD>
frame <TD>Cell Data</TD>
<HTML>
rules <HEAD> </TR>
<TABLE>
cell spacing & cellpadding <TITLE></TITLE>
</BODY>
</HEAD>
align <BODY> </HTML>
back ground <TABLE border= “1”>
<TR>
Bgcolor <TD>Cell Data</TD>
height and width <TD>Cell Data</TD>
<TD>Cell Data</TD>
</TR>
The RULES attribute like FRAME, also works with the BORDER attribute, except RULES
<HTML>
deals with the inside border edges. <HEAD> <TR>
<TITLE></TITLE> <TD>Cell Data</TD>
Values that can be specified for RULES attribute </HEAD>
are: <TD>Cell Data</TD>
<BODY> <TD>Cell Data</TD>
all – displays all borders <TABLE border= “1” </TR>
bordercolor=”red” <TABLE>
cols – displays border between cells. rules =”rows”> </BODY>
<TR> </HTML>
<TD>Cell Data</TD>
groups – displays borders between all cell group
<TD>Cell Data</TD>
<TD>Cell Data</TD>
none – hides all interior borders
</TR>
Cell padding- gives the amount of space between the cell border and the cell contents. .
<HTML> <TR>
<HEAD>
<TITLE></TITLE> <TD>Cell Data</TD>
</HEAD> <TD>Cell Data</TD>
<BODY>
<TABLE align=”center”> <TD>Cell Data</TD>
<TR> </TR>
<TD>Cell Data</TD>
<TD>Cell Data</TD> <TABLE>
<TD>Cell Data</TD> </BODY>
</TR>
</HTML>
Web Applications Development Technologies 06/19/2023
BACKGROUND attribute
37
Used to set an image as background of a table.
<HTML> <TR>
<HEAD> <TD>Cell Data</TD>
<TITLE></TITLE>
</HEAD> <TD>Cell Data</TD>
<BODY> <TD>Cell Data</TD>
<TABLE align=”center” background=”flower.jpg”>
<TR> </TR>
<TD>Cell Data</TD> <TABLE>
<TD>Cell Data</TD>
<TD>Cell Data</TD> </BODY>
</TR> </HTML>
Page layout refers to the way in which the Web designer presents information to users.
Content is essential; however, the layout and delivery are just as important.
Your target audience, the stakeholders' requirements and your design restrictions will
determine how you enable these characteristics and how you will integrate them into your
page layouts.
The layout does not force you to read one story on the front page
This layout style is often compared to an inverted pyramid, as depicted in the following
figure
This style offers the user a list of story summaries first, then
references to the details of each story for those interested.
In any case, if users want further information on any topic, they can
browse to it at their discretion. Otherwise, they can move on to other
pursuits.
Before you begin the Web production process, consider the look and structure of your site.
The Web page elements include layout, color, fonts and images, and other multimedia.
Consider the following items and their functions when planning your Web page layout
Space (also called white space):- separates elements on the page and reduces page element
clutter.
Color:- conveys a visual tone or message, and provides a consistent look and feel
Font:- conveys a visual tone or message, provides a consistent look and feel, and enhances
readability
Web sites use some common basic structures to perform certain important functions. You
can see these common features in action by browsing several sites. For example, navigation
elements are generally located on the left and top margins.
o Black text on a white background is common,
as are company logos in the upper-left corner
of the display. These and other common layout
features actually help each other and the user,
which is the reason they are used so often.
Traditional left-margin layout
Web Applications Development Technologies 06/19/2023
Cont….
44
● Top-margin layout: - the top-margin ● Distributed left- and top-margin
layout, in which navigational elements are layout:- the most commonly used
placed along the top of the page. layout, the distributed left- and top-
margin layout.
The first part is the form that you see on the page itself. Forms are made up of buttons,
text fields, and pull-down menus (collectively known as form controls) used to collect
information from the user
The second component of a web form is an application or script on the server that
processes the information collected by the form and returns an appropriate response
Single-line text input controls: Used for items that require only one line of user input, such
as search boxes or names. They are created using the <input> element.
Password input controls: Single-line text input that mask the characters a user enters.
Multi-line text input controls: Used when the user is required to give details that may be
longer than a single sentence. Multi-line input controls are created with the <textarea>
element.
representing each form control and the value the user entered.
Value: Provides an initial value for the text input control that the user will see when the
form loads.
Size: Allows you to specify the width of the text-input control in terms of characters.
maxlength: Allows you to specify the maximum number of characters a user can enter into the
Web Applications Development Technologies 06/19/2023
Password input controls
54
</form>
Will result
Will result:-
There are various ways in HTML to create clickable buttons. You can create clickable
Reset: This creates a button that automatically resets form controls to their initial values.
button: This creates a button that is used to trigger a client-side script when the user clicks
that button.
Checkboxes are used when more than one option is required to be selected.
<form>
<input type="checkbox" name="maths" value="on"> Maths<br>
Value: The value that will be used if the checkbox is selected. More than one checkbox
should share the same name only if you want to allow users to select several items from the
same list.
Checked: Indicates that when the page loads, the checkbox should be selected.
</form>
Will result
● Value: Used to indicate the value that will be sent to the server if this option is selected.
● Checked: Indicates that this option should be selected by default when the page loads.
selected: Specifies that this option should be the initially selected value when the page
loads.
label: An alternative way of labeling options.
If you want to allow a user to upload a file to your web site from his computer, you will
need to use a file upload box, also known as a file select box. This is also created using the
<input> element.
</form>
will result