Website Note
Website Note
Website Note
DEVELOPMENT
Table of content
Acronyms ............................................................................................................. 2
Learning outcome 1.2 Design the web page Layout to match design
specifications. .................................................................................................. 12
Learning outcome 2.1 Use the appropriate Format, style and layout of the
elements on a web page as design specifications ............................................. 52
Learning Unit 3: Ensure website content meets technical protocols and standards.
........................................................................................................................... 80
Learning Outcome 3.1 Verify and validate the web content in accordance with
required standards. ......................................................................................... 82
Learning Outcomes: 5.1 Identify social web to be integrated with website ...... 140
This course is intended for people who are already Software development.
Learning Units:
Learning outcomes:
Duration: 2hrs
Resources
✓ Books.
✓ Computer. ✓ Papers.
✓ Pens.
✓ Markers.
✓ Pencils.
✓ Board.
B. Navigation Tools.
Web-page navigation tools are located in several areas outside of the header
including the right or left sides, center or boottom of the page. They offer page-
to-page navigation or instant jump to the top of the current page. Designs
feature text or image based one click links organized standalone or in tab, drop
down or pop up menu and list layouts. Some sites also feature breadcrumb
trails links to every page you would visit to reach the current page organized
left to right on a harizontal line in the header or top center of the page in the
order of your movement through the site, if you were to follow the site’s
organizational hierarchy.
C. Primary content
The primary content area on a page is traditionally located to the left or right of
sidebar or between two sidebars. It provides main page information you want a
visitor to focus on. The primary content area features a main title and content
formatted into concise text paragraphs, images, videos or combination elements
divided by spaces or subheadings. It also often features elements previously
mentioned such as a breadcrumb trail and jump navigation links, as well as
update information such as content publication or update dates and links to
websites relevant to the content or that you think would interest visitors.
Sidebar columns, also knowns as sidebars, run vertically along the left or right
side of web pages. They usually provide primary or secondary site navigation
links and information you want to emphasize such as contact details or
important updates about the site operator or the topic of the site. Other
elements often placed in sidebars include personal or partner advertising, a site
search box and search filter tools. Sidebars usually display information as an
unbroken column or a column divided into sections or boxer.
E. Page Footer
The footer runs horizontally across the bottom of pages. It provides navigation
links visitors might find useful, as well as details about a page or website such
as a logo, copyright date, website operator’s name, page author name, legal
statements and links to the site terms of use and privacy policies. Other
elements aften placed in the foot include links to the site operator’s contact page
oe email address, job postings page, feedback form page, support page and
frequently asked questions page.
User interface (UI) is important to meet user expectations and support the
effective functionality of your site. A well-executed user interface facilitates
Written assessment
1. A user interface (UI) is the space where interactions between humans and
machines occur. Describe two (2) types of User Interface.
2. Identify any five (3) basic Page structure and site design
Duration: 8hrs
Is also responsible for telling a Web browser (e.g., Microsoft Internet Explorer,
Mozilla Firefox, Opera, Mac Safari, Google Chrome, and so on) how text and
other objects in a Web document should appear. Whether the text should be
small, large, bold, underlined, or right or left justified is largely determined by
the HTML embedded in a Web page.
Software namely, Web browsers. You create content specifying how the browser
should Display it (highlighting certain pieces of text, and so on). When the
browser displays the page, it applies the appropriate formatting accordingly so
the user sees the text and document as you intended. You need a way to mark
up the text so the browser understands it.
In the early 1990s, a Hypertext Markup Language (HTML) was created, it is not
a programming language but a language created to provide a way for users
to markup documents so Web browsers could display certain elements of
the document in italics, underlined, and so on.
a browser) is application software for accessing the World Wide Web or a local
website. When a user requests a web page from a particular website, the web
The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML
documents and display them correctly.
A browser does not display the HTML tags, but uses them to determine how to
display the document:
Examples of browser
1. Mozilla firefox 10. Chromium
2. Google chrome 11. Tor browser
3. Safari 12. Maxthon
4. Opera 13. Yandex browser
5. Internet Explorer 14. Lynx
6. Microsoft Edge 15. Epic
7. Netscape Navigator 16. SeaMonkey
8. Brave 17. UC Browse
9. Vivaldi
used for websites or other web documents. With text-based HTML editors, the
source code can be edited directly.
These instructions are delimited. This means that they are enclosed in angle
brackets more commonly known as ‘‘less than’’ and ‘‘greater than’’ signs (<
and >).
<b> </b>
Output:
Example:
<p> This is a paragraph </p>
<hr>
Here, the <hr> is the unpaired tag used to create a horizontal line. In older
versions, you might see hr tag written as <hr/> instead of <hr>. These tags are
also called Empty Tag.
Self-Closing Tags are those HTML tags that do not have a partner tag, where
the first tag is the only necessary tag that is valid for the formatting. The main
and important information is contained WITHIN the element as its attribute.
An image tag is a classic example of a self-closing tag. Let’s see it in action
below:
Example:
element is everything from the start tag to the end tag. They consist of some
kind of structure or expression. It generally consists of a start tag, content
and an end tag.
Example:
Whatever written
within a HTML tag
HTML tag starts with < are HTML HTML attributes are found
and ends with > elements? only in the starting tag.
The <html> element is the root element and it defines the whole
HTML document. It has a start tag <html> and an end
tag </html>.
The contents of a page title are very important for search engine
optimization (SEO)! The page title is used by search engine
algorithms to decide the order when listing pages in search
results.
<h1> defines the most important heading. <h6> defines the least
important heading.
Example
Output:
Example
Output:
Output:
Example
Example:
Output:
The <u> tag in HTML stands for underline, and it’s used to
underline the text enclosed within the <u> tag. This tag is
generally used to underline misspelled words. This tag requires a
starting as well as ending tag.
Syntax:
<u> Contents... </u>
Example:
Output:
Example:
Output:
Example:
Output:
Example:
Output:
Example:
Example:
The HTML <del> element defines text that has been deleted from
a document. Browsers will usually strike a line through deleted
text
Example:
My favorite color is <del>blue</del> red.
Output: My favorite color is blue red.
The HTML <ins> element defines a text that has been inserted into a
document. Browsers will usually underline inserted text:
Example:
My favorite color is <del>blue</del> <ins>red</ins>
Output: My favorite color is blue red
The HTML <sub> element defines subscript text. Subscript text appears
half a character below the normal line, and is sometimes rendered in a
smaller font. Subscript text can be used for chemical formulas, like H2O:
<p>
H<sub>2</sub>O
Output:
This is subscripted text.
H2O
Example:
<p>
125<sup>2</sup>
Output:
This is superscripted text.
1252
Here are the most common image file types, which are supported in all
browsers (Chrome, Edge, Firefox, Safari, Opera):
HTML Lists are used to specify lists of information. All lists may contain one or
more list elements. There are three different types of HTML lists:
1. Ordered List or Numbered List <ol>: Used to create a list of related items,
in no particular order.
2. Unordered List or Bulleted List <ul>: Used to create a list of related items,
in a specific order.
3. Description List or Definition List <dl>: Used to create a list of terms and
their descriptions.
Example
<!DOCTYPE html>
<html>
This will produce the following
<head>
result
<title>HTML unordered
List</title>
</head>
<body>
<ol> • Beetroot
<li>Beetroot</li> • Ginger
<li>Ginger</li>
<li>Potato</li> • Potato
<li>Radish</li> • Radish
</ol>
</body>
</html>
Example
<body> 2. Ginger
<ol> 3. Potato
<li>Beetroot</li> 4. Radish
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
</body>
</html>
Ordered List use different type attribute for <ol> tag to specify the type
of numbering you like. By default, it is a number.
Following are the possible option
✓ <ol type = "1"> Default-Case Numerals.
✓ <ol type = "I"> Upper-Case Numerals.
✓ <ol type = "i"> Lower-Case Numerals.
✓ <ol type = "A"> Upper-Case Letters.
✓ <ol type = "a"> Lower-Case Letters.
<body> 2. Ginger
<body> B. Ginger
<body> b. Ginger
Definition list <dl>: is used to list items along with a description of each item.
Definition lists are typically formatted with the term on the left with the
definition following on the right or on the next line. The <dl> tag is used in
conjunction with <dt> (defines terms/names) and <dd> (describes each
term/name).
The <dt> tag defines a term/name in a description list. The <dt> tag is used in
conjunction with <dl> (defines a description list) and <dd> (describes each
term/name).
The HTML tables are created using the <table> tag in which the <tr> tag is
used to create table rows and <td> tag is used to create data cells. The elements
under <td> are regular and left aligned by default
Example
A. Table Heading
Table heading can be defined using <th> tag. This tag will be put to replace
<td> tag, which is used to represent actual data cell. Normally you will put your
top row as table heading as shown below, otherwise you can use <th> element
in any row. Headings, which are defined in <th> tag are centered and bold by
default
Example
There are two attributes called cellpadding and cellspacing which you will
use to adjust the white space in your table cells.
Example
You will use colspan attribute if you want to merge two or more columns into
a single column. Similar way you will use rowspan if you want to merge two or
more rows.
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Output:
Colspan/Rowspan</title>
</head>
<body>
<table border = "1">
<tr> Column 1 Column 2 Column 3
<th>Column 1</th>
<th>Column 2</th> Row 1 Cell 2 Row 1 Cell 3
<th>Column 3</th> Row 1 Cell 1
</tr> Row 2 Cell 2 Row 2 Cell 3
<tr>
<td rowspan = "2">Row 1 Cell
1</td> Row 3 Cell 1
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan = "3">Row 3 Cell
1</td>
</tr>
</table>
</body>
</html>
D. Tables Backgrounds
You can set table background using one of the following two ways:
• bgcolor attribute: You can set background color for whole table or
just for one cell. You can also set border color also
using bordercolor attribute.
• background attribute: You can set background image for whole
table or just for one cell.
Example Using bgcolor or bordercolor
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Output:
Background</title>
</head>
<body>
<table border = "1" bordercolor =
"green" background = "/images/test.png">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
N.B: This will produce the following result. Here background image did not
apply to table's header.
You can set a table width and height using width and height attributes. You
can specify table width or height in terms of pixels or in terms of percentage of
available screen area.
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Output:
Width/Height</title>
</head>
Row 1, Column 1 Row 1, Column 2
<body>
<table border = "1" width = "400"
height = "150">
<tr>
<td>Row 1, Column 1</td> Row 2, Column 1 Row 2, Column 2
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
</body>
</html>
➢ header,
➢ body, and
➢ foot.
The head and foot are rather similar to headers and footers in a word-
processed document that remain the same for every page, while the body is the
main content holder of the table.
The three elements for separating the head, body, and foot of a table are:
Example
<!DOCTYPE html>
<html>
<head> Output:
<title>HTML Table</title>
</head>
<body>
<table border = "1" width = "400">
<thead>
<tr>
<td colspan = "4">This is the
head of the table</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan = "4">This is the
foot of the table</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr></tbody></table></body></html>
Written assessment
2. What are the two things you need to create and view web pages?
A. Yes, always
C. No
D. Both A and B
A. <body>
B. <html>
C. <title>
D. <head>
B. 2-5
C. 1-4
D. 1-3
A. A Netscape errors
C. Nothing
A. list tag
B. ls tag
C. li tag
D. ol tag
Practical assessment
1.Using ordered and unordered lists, create a web page that displays months
of a year grouped according to the number of days each month has. That is, all
the months having 31 days should be grouped together followed by months
having 30 days and February should be placed in a separate group
2. Create a web page that gives basic information about yourself. The page
should display your personal information, academic qualification, professional
qualification, job experience etc. Your page should be well-designed and should
look attractive.
Learning outcomes:
2.1 Use the appropriate Format, style and layout of the elements on a web
2.2. Test and validate the layout with reference to design specifications.
Duration: 2hrs
Resources
✓ Books.
✓ Computer. ✓ Papers.
✓ Pens.
✓ Markers.
✓ Pencils.
✓ Board.
Learning outcome 2.1 Use the appropriate Format, style and layout of
the elements on a web page as design specifications
With CSS, you can control the color, font, the size of text, the spacing between
elements, how elements are positioned and laid out, what background images
or background colors are to be used, different displays for different devices and
screen sizes, and much more!
The word cascading means that a style applied to a parent element will also
apply to all children elements within the parent. So, if you set the color of the
body text to "blue", all headings, paragraphs, and other text elements within
the body will also get the same color.
With CSS you can define for each HTML tag, a specific format which will
applied on it.
The selector refers to the HTML tag or element that we want to apply the style
on. A selector can be an HTML element name, id, class, or an attribute etc.
For example, the above figure defines properties for <h1> tag. A declaration is
a combination of a property name and a value separated by a colon. Each
declaration must end with a semi-colon, even if there is only one declaration.
The declaration set must be included between curly-braces. A CSS rule-set
can be written in a single line, or multiple lines. That is we can define the
style for <h1> as
h1
• a selector,
• and one or more declarations:
The selector is normally the HTML element you want to style.
Values specify the settings you want to use for the chosen properties. For
example, if you want to specify a color property then the value is the color you
want the text in these elements to be.
The most common way to add CSS, is to keep the styles in external CSS files.
However, in this tutorial we will use inline and internal styles, because this is
easier to demonstrate, and easier for you to try it yourself.
The following example sets the text color of the <h1> element to blue, and the
text color of the <p> element to red:
Example
An internal CSS is used to define a style for a single HTML page. An internal
CSS is defined in the <head> section of an HTML page, within
a <style> element.
The following example sets the text color of ALL the <h1> elements to blue,
and the text color of ALL the <p> elements to red. In addition, the page will be
displayed with a "powderblue" background color:
Example
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
An external style sheet is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the <head> section of each
HTML page:
Example
The external style sheet can be written in any text editor. The file must not
contain any HTML code, and must be saved with a .css extension.
"styles.css":
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p{
color: red;
}
The <link>element can be used in an HTML document to tell the browser where
to find the CSS file used to style the page. It is an empty element (meaning it
href
This specifies the path to the CSS file (which is often placed in a folder called
css or styles).
Type
This attribute specifies the type of document being linked to. The value should
be text/css.
rel
This specifies the relationship between the HTML page and the file it is linked
to. The value should be stylesheet when linking to a CSS file. An HTML page
can use more than one CSS style sheet. To do this it could have a element for
every CSS file it uses. For example, some authors use one CSS file to control
the presentation (such as fonts and colors) and a second to control the layout.
External style sheets can be referenced with a full URL or with a path relative
to the current web page.
Example
This example links to a style sheet located in the html folder on the current
web site:
Example
This example links to a style sheet located in the same folder as the current
page:
✓ Easier Maintenance
✓ Reduced File Size
✓ Reduced Bandwidth
✓ Improved Flexibility
2.2. Test and validate the layout with reference to design specifications.
2.2.1 Element Selector
An element selector specifies the style for an element by name. For example, if
we want to change the style of <p> element in a web page, we need to define a
style for <p> as shown below.
Once the style is defined, it will be applied to all paragraphs (tag <p>)
automatically by the browser. A complete example of HTML code is given
below. Note that we are using internal style sheets in our example. You can
use external style sheets, if you like.
<!DOCTYPE html>
<html>
<head>
<title>Element Selector</title>
<style>
body {
background-color: blue;
} p { font-
size: 25px; color:
white; text-align:
center;
}
</style>
</head>
<body>
<p>This line is written in first Paragraph </p>
<p>This line is written in second Paragraph </p>
</body>
</html>
2.2.2 ID Selector
The ID selector is used to select a specific HTML element. The ID of an
element must be unique. To select an element with a specific ID, (#)
character is used with ID name. Suppose we want to apply a style to one or
more specific paragraphs (but not to all), then we should define the style as:
#p1
{
font-size: 25px;
color: white;
text-align: center;
}
Now, we can use the above style with a paragraph by specifying the above style
as shown below:
Note that the element selector applies to all whereas an ID selector is applied
to the selected elements. We can define multiple styles for a single element.
Try the following example and observe the output. We notice that style is
applied to the second paragraph only.
<!DOCTYPE html>
<html>
<head>
<title>Class Selector</title>
<style>
body {
background-color: blue;
}
.p1
{
font-size: 25px;
color: white; text-
align: center;
}
</style>
</head>
<body>
<p>This line is written in first Paragraph </p>
<p class="p1">This line is written in second Paragraph
</p> </body></html>
/* A comment */
The following code shows how useful comments can be written in an HTML
document. See the code below how we can write useful comments in an HTML
document.
1. Background property
2. Border, margin & padding properties
3. Height / width property
4. Text
5. Fonts
6. links
7. Lists
8. Tables
We will discuss how to set the above properties in this and the next unit. Let
us start with the background property.
Property Description
background-color: color;
bod
y{
background-color: lightblue;
}
The following example shows how to set background color for a paragraph
p
{
background-color: yellow;
}
Similarly, the following code can be used to set the background-color for
<h1>.
h
1{
<!DOCTYPE html>
<html>
<head>
<title>Background Property in CSS</title>
<style> body
{
background-color: blue;
}
</style>
</head>
<body>
<h1>Playing with colors</h1>
<p>This line is written in first Paragraph </p>
<p>This line is written in second Paragraph </p>
</body>
</html>
2.2.5.3 background-image
We can use an image as a background of an HTML document to make it look
like a wallpaper. The following example illustrates how to use background-
image property:
bod
y {
background-image: url("paper.gif");
}
By default, the image is repeated on the screen to cover the whole document.
Try the following code and see the output in the browser.
Some images are designed in a way that they can be attached to each
other, either horizontally or vertically, to form a certain design. By default,
background-image property repeats the images both vertically and
horizontally. To set the repeat direction of a background image, we use
backgroundrepeat property that accepts one of two values: repeat-x or
repeat-y. To prevent the image from being repeated, we use the value no-
repeat.
<!DOCTYPE html>
<html>
<head>
<title>Element Selector</title>
<style> body {
background-image: url("tree.png");
background-repeat: repeat;
} p {
color: red;
text-align: center;
}
</style>
</head>
2.2.5.5 background-attachment
This property determines whether that background image will scroll or not
when the content with which it is associated scrolls. This can be specified
by background-attachment property as shown in the following code.
bo
dy
{
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-attachment: fixed;
}
2.2.5.6 background-position
This property determines the position of the background image within the
canvas space used by its element. The background position can be set to
"left top", "left center", "left bottom", "right top", "right center", "right
bottom", "center top", "center center". If we specify only one value only, the
second value is taken as center.
The following example defines the position of the background image as top
right side of the document.
body
{
background-image: url("tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
The following code displays an image on the top right side of the web page.
We can see in the output that the image is displayed on the top right side
of the web page, while “backgroundattachment” is used to fix the
background image so that image will not scroll.
1. Create the web page by removing the style from the HTML document and
store it in a CSS file instead. Link your document with the style sheet.
2. Repeat the above activity by using inline style.
➢ CSS treats each HTML element as if it appears inside its own box and uses
rules to indicate how that element should look.
➢ Rules are made up of selectors (that specify the elements the rule applies to)
and declarations (that indicate what these elements should look like).
➢ Different types of selectors allow you to target your rules at different
elements.
➢ Declarations are made up of two parts: the properties of the element that
you want to change, and the values of those properties. For example, the
font-family property sets the choice of font, and the value arial specifies
Arial as the preferred typeface.
➢ CSS rules usually appear in a separate document, although they may
appear within an HTML page
Written assessment
8. What is the correct CSS syntax for making all the <p> elements bold?
A. <p style = "text-size:bold">
B. p {font-weight:bold}
C. p {text-size:bold}
D. <p style = "font-size:bold">
9. What is the correct CSS syntax for displaying background image?
A. body { background-image: url("paper.gif"); }
B. background.body: "paper.gif"
C. body {background-image = "paper.gif"
D. None of the above
10. Which CSS property is used to specify position of the background image?
A. background-position
B. image-position
C. background-image-position
D. None of the above
Answer Key:
1. D 2. B 3. C 4. B 5. A 6. A 7. C 8. B 9. A 10. A
1. Create a CSS with suitable background properties for a web page that
gives some basic information about your city (add some nice photos as
well).
2. Create a website that gives basic information about yourself. You
should prepare a separate page for each of the following: personal
information, academic qualification, professional qualification, job
experience, hobbies, and photo gallery. Academic qualification page
should display the information about your degrees and certificates
along with the subjects you studied in each in a tabular form. Create
suitable CSS file and link it with all of your pages.
Learning outcomes:
3.1. Verify and validate the web content in accordance with required standards.
Duration: 2hrs
Resources
✓ Books.
✓ Computer. ✓ Papers.
✓ Pens.
✓ Markers.
✓ Pencils.
✓ Board.
An HTML form facilitates the user to enter data that is to be sent to the server
for processing such as name, email address, password, phone number, etc.
An HTML form is used to collect user input. The user input is most often sent
to a server for processing.
Example:
HTML forms are required if you want to collect some data from of the site visitor.
For example: If a user wants to purchase some items on internet, he/she must
fill the form such as shipping address and credit/debit card details so that item
can be sent to the given address.
<form>
.
form elements
.
</form>
The HTML <form> element can contain one or more of the following form
elements:
11. <optgroup>
The <label> element is useful for screen-reader users, because the screen-
reader will read out loud the label when the user focus on the input element.
Example:
<body>
<form>
<input type="text">
</form>
</body>
Here are the different input types you can use in HTML:
➢ <input type="text">
➢ <input type="password">
➢ <input type="button">
<input> element of type "text" is used to define a single-line input text field.
Example:
<form>
<label>Enter first name</label><br>
<input type="text"><br>
</form>
2. <input type="password">:
The <input> element of type "password" allow a user to enter the password
securely in a webpage. The entered text in password filed converted into "*" or
".", so that it cannot be read by another user.
Example:
<form>
<label>Enter User name</label><br>
<input type="text"><br>
<label>Enter Password</label><br>
<input type="Password"><br>
</form>
Output:
3. <input type="submit">:
The <input> element of type "submit" defines a submit button to submit the
form to the server when the "click" event occurs.
<input type="text"><br>
<label> Enter Password</label><br>
<input type="Password"><br>
<br><input type="submit" >
</form>
Example:
4. <input type="reset">:
The <input> type "reset" is also defined as a button but when the user performs
a click event, it by default reset the all inputted values.
Example:
<input type="text"><br>
<label>Enter Password</label><br>
<input type="Password"><br>
<br><input type="submit" >
</form>
5. <input type="radio">:
The <input> type "radio" defines the radio buttons, which allow choosing an
option between a set of related options. At a time only one radio button option
can be selected at a time.
Example:
<form>
<p>Kindly Select your favorite color</p>
Output:
Red
blue
green
Bottom of Form
6. <input type="checkbox">:
The <input> type "checkbox" are displayed as square boxes which can be
checked or unchecked to select the choices from the given options.
Example:
<form>
<h2>Registration Form</h2>
<label>Enter your Name:</label>
</form>
Output:
Registration Form
Tennis
Football
Baseball
Badminton
submit
Bottom of Form
N.B: The "radio" buttons are similar to checkboxes, but there is an important
difference between both types: radio buttons allow the user to select only one
option at a time, whereas checkbox allows a user to select zero to multiple
options at a time.
7. <input type="button">:
The <input> type "button" defines a simple push button, which can be
programmed to control a functionally on any event such as, click event.
Example:
<form>
<input type="button" value="Clcik me ">
</form>
8. <input type="file">:
The <input> element with type "file" is used to select one or more files from
user device storage. Once you select the file, and after submission, this file can
be uploaded to the server
<form>
<label>Select file to upload:</label>
</form>
9.<input type="image">:
The <input> type "image" is used to represent a submit button in the form of
image.
Example:
<!DOCTYPE html>
<html>
<body>
<h2>Input "image" type. </h2>
<label>User id:</label><br>
<input type="text" name="name"><br><br>
</body>
</html>
10.<input type=" Color ">:
The <input type="color"> is used for input fields that should contain a color.
Depending on browser support, a color picker can show up in the input field.
<form>
<label for="favcolor">Select your favorite color:</label>
<input type="color" name="favcolor">
</form>
11.<input type="date">:
The <input type="date"> is used for input fields that should contain a date.
Depending on browser support, a date picker can show up in the input field.
Example
<form>
<label for="birthday">Birthday:</label>
<input type="date" name="birthday">
</form>
You can also use the min and max attributes to add restrictions to dates:
Example
<form>
<label for="datemax">Enter a date before 1980-01-01:</label>
<input type="date" name="datemax" max="1979-12 31"><br><br>
<label for="datemin">Enter a date after 2000-01-01:</label>
<input type="date" name="datemin" min="2000-01-02">
</form>
12.<input type="email">:
The <input type="email"> is used for input fields that should contain an e-mail
address.
Example
<form>
<label for="email">Enter your email:</label>
<input type="email" name="email">
</form>
13.<input type="month">
The <input type="month"> allows the user to select a month and year.
Depending on browser support, a date picker can show up in the input field.
Example
<form>
<label >Birthday (month and year):</label>
<input type="month" name="bdaymonth">
</form>
14.<input type="number">
The following example displays a numeric input field, where you can enter a
value from 1 to 5:
<form>
<label>Quantity (between 1 and 5):</label>
<input type="number" name="quantity" min="1" max="5">
</form>
Example
<form>
<label>Quantity:</label>
<input type="number" name="quantity" min="0" max="100" step="10" v
alue="30">
</form>
15.<input type="range">:
Example
<form>
<label >Volume (between 0 and 50):</label>
<input type="range" name="vol" min="0" max="50">
</form>
16.<input type="search">
The <input type="search"> is used for search fields (a search field behaves
like a regular text field).
<form>
<label for="gsearch">Search Google:</label>
<input type="search" name="gsearch">
</form>
17.<input type="tel">:
The <input type="tel"> is used for input fields that should contain a
telephone number.
Example
<form>
<label for="phone">Enter your phone number:</label>
<input type="tel" name="phone" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}">
</form>
18.input type="time">
The <input type="time"> allows the user to select a time (no time zone).
Example
<form>
<label for="appt">Select a time:</label>
<input type="time" name="appt">
</form>
19.<input type="url">
The <input type="url"> is used for input fields that should contain a URL
address.
Some smartphones recognize the url type, and adds ".com" to the
keyboard to match url input.
Example
<form>
<label for="homepage">Add your homepage:</label>
<input type="url" name="homepage">
</form>
20.<input type="week">
The <input type="week"> allows the user to select a week and year.
Example
<form>
<label for="week">Select a week:</label>
<input type="week" name="week">
</form>
Example
Output:
Volvo
Choose a car:
Example
Visible Values:
Example
Use the multiple attribute to allow the user to select more than one value:
Example
The rows attribute specifies the visible number of lines in a text area.
You can also define the size of the text area by using CSS:
Example
Example
<form action="/action_page.php">
<fieldset>
<legend>Personalia:</legend>
<label for="fname">First name:</label><br>
<input type="text" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" name="lname" value="Doe"><br><br>
<input type="submit" value="Submit">
</fieldset>
</form>
Users will see a drop-down list of the pre-defined options as they input data.
The list attribute of the <input> element, must refer to the id attribute of
the <datalist> element.
Example
<form action="/action_page.php">
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
</form>
<form action="/action_page.php"
oninput="x.value=parseInt(a.value)+parseInt(b.value)">
0
<input type="range" id="a" name="a" value="50">
100 +
<input type="number" id="b" name="b" value="50">
=
<output name="x" for="a b"></output>
<br><br>
<input type="submit">
</form>
This chapter describes the different attributes for the HTML <form> element.
The action attribute defines the action to be performed when the form is
submitted.
Usually, the form data is sent to a file on the server when the user clicks on
the submit button.
In the example below, the form data is sent to a file called "action_page.php".
This file contains a server-side script that handles the form data:
Example
<form action="/action_page.php">
<label for="fname">First name:</label><br>
If the action attribute is omitted, the action is set to the current page.
The method attribute specifies the HTTP method to be used when submitting
the form data.
Example
This example uses the GET method when submitting the form data:
Example
This example uses the POST method when submitting the form data:
GET:
POST:
• Appends the form data inside the body of the HTTP request (the
submitted form data is not shown in the URL)
• POST has no size limitations, and can be used to send large amounts of
data.
• Form submissions with POST cannot be bookmarked
The target attribute specifies where to display the response that is received
after submitting the form.
Value Description
The default value is _self which means that the response will open in the
current window.
Example
The input value attribute specifies an initial value for an input field:
Example
<form>
<label for="fname">First name:</label><br>
<input type="text" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" name="lname" value="Doe">
</form>
A read-only input field cannot be modified (however, a user can tab to it,
highlight it, and copy the text from it).
The value of a read-only input field will be sent when submitting the form!
Example
<form>
<label for="fname">First name:</label><br>
<input type="text" name="fname" value="John" readonly><br>
<label for="lname">Last name:</label><br>
<input type="text" name="lname" value="Doe">
</form>
The input disabled attribute specifies that an input field should be disabled.
The value of a disabled input field will not be sent when submitting the form!
Example
<form>
<label for="fname">First name:</label><br>
<input type="text" name="fname" value="John" disabled><br>
<label for="lname">Last name:</label><br>
<input type="text" name="lname" value="Doe">
</form>
The input size attribute specifies the visible width, in characters, of an input
field.
Note: The size attribute works with the following input types: text, search, tel,
url, email, and password.
Example
<form>
<label for="fname">First name:</label><br>
N.B: When a maxlength is set, the input field will not accept more than the
specified number of characters. However, this attribute does not provide any
feedback.
Example
<form>
<label for="fname">First name:</label><br>
<input type="text" name="fname" size="50"><br>
<label for="pin">PIN:</label><br>
<input type="text" name="pin" maxlength="4" size="4">
</form>
The input min and max attributes specify the minimum and maximum
values for an input field.
The min and max attributes work with the following input types: number,
range, date, datetime-local, month, time and week.
<form>
<label for="datemax">Enter a date before 1980-01-01:</label>
<input type="date" name="datemax" max="1979-12-31"><br><br>
The input multiple attribute specifies that the user is allowed to enter more
than one value in an input field.
The multiple attribute works with the following input types: email, and file.
Example
<form>
<label for="files">Select files:</label>
<input type="file" name="files" multiple>
</form>
The input pattern attribute specifies a regular expression that the input
field's value is checked against, when the form is submitted.
The pattern attribute works with the following input types: text, date, search,
url, tel, email, and password.
An input field that can contain only three letters (no numbers or special
characters):
<form>
<label for="country_code">Country code:</label>
<input type="text" name="country_code"
pattern="[A-Za-z]{3}" >
</form>
The input placeholder attribute specifies a short hint that describes the
expected value of an input field (a sample value or a short description of the
expected format).
The short hint is displayed in the input field before the user enters a value.
The placeholder attribute works with the following input types: text, search,
url, tel, email, and password.
Example
<form>
<label for="phone">Enter a phone number:</label>
<input type="tel" name="phone" placeholder="123-45-678"
pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}">
</form>
The input required attribute specifies that an input field must be filled out
before submitting the form.
The required attribute works with the following input types: text, search, url,
tel, email, password, date pickers, number, checkbox, radio, and file.
Example
<form>
<label for="username">Username:</label>
<input type="text" name="username" required>
</form>
The input height and width attributes specify the height and width of
an <input type="image"> element.
Example
Define an image as the submit button, with height and width attributes:
<form>
<label for="fname">First name:</label>
<input type="text" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" name="lname"><br><br>
<input type="image" src="img_submit.gif" alt="Submit" width="48" height="4
8">
</form>
Form Validation
Form validation is a “technical process where a web-form checks if the
information provided by a user is correct.”
The form will either alert the user that they messed up and need to fix
something to proceed, or the form will be validated and the user will be able to
continue with their registration process.
Example:
Twitter won’t let me use an email address that is incorrectly formatted, and
gives me an error message.
Example:
<!DOCTYPE html>
<html lang="en">
<body>
<p>Required Attribute</p>
<form>
<label>Name:</label>
<label>Email:</label>
</form>
</body>
</html>
Output:
N.B: When the maxlength attribute is set, it will not allow the user to enter
more characters than those specified.
Example:
<!DOCTYPE html>
<html lang="en">
<body>
<p>Maxlength Attribute</p>
<form>
<label>Roll No.</label>
<label>Email:</label>
</form>
</body>
</html>
Output:
N.B: When the minlength attribute is set, an input field will not accept lesser
characters than those specified.
Example:
<!DOCTYPE html>
<html lang="en">
<body>
<p>minlength Attribute</p>
<form>
<label>Roll No.</label>
<label>Email:</label>
</form>
</html>
Output:
The min and max attributes of the input field are used to specify the
minimum and maximum allowed values for an input field. We can create a
range of allowed values using min and max together.
min specifies the minimum value an input field can have whereas max
specifies the maximum value for a field.
The min and max attributes work with the various input types such as
number, range, date, datetime, month, time and week. We can use these
attributes in a field where we want a user to enter some amount. We can set
the maximum limit and minimum limit for the amount to be entered.
Syntax:
Example:
<!DOCTYPE html>
<html lang="en">
<body>
<form>
<label>Email:</label>
</form>
</body>
</html>
Output:
5. Pattern Validation:
The pattern attribute defines a particular pattern that an input field’s value
must satisfy when the form is submitted. The pattern attribute works with
Syntax:
Example:
<!DOCTYPE html>
<html lang="en">
<body>
<p>Pattern Attribute</p>
<form>
<label>Tel.</label>
<label>Email:</label>
</form>
</body>
</html>
Output:
6. Email Validation
To validate an email address of an input field, just set the input type
to "Email".
Example
<form name="Form">
</form>
7. Number Validation
To validate that an input field has a number, just set the input type
to "number".
Example
<form name="Form">
</form>
8. URL Validation
To validate that an input field has an URL, set the input type to "URL".
<form name="Form">
</form>
1. Create a web page that gives some basic information about your
city (add some nice photos as well). At the end of the page,
create a simple form for more information form that allows the
users to input their names, email addresses, and comments.
a. Add a checkbox on the web page asking the reader either he likes
to join the group.
b. Add a drop down list that allows the user to select his/her
country.
Dropdown list: It is a list of items for selecting a value from pull down menu.
Radio button: It is used to select one option from set of many option
Written assessment
Answer Key:
1. B 2. B 3. A 4. A 5. C 6. B 7. A 8. A 9. C
Learning outcomes:
Resources
✓ Books.
✓ Computer. ✓ Papers.
✓ Pens.
✓ Markers.
✓ Pencils.
✓ Board.
So, you’ve just signed your terms and engaged in website design services with
Primal Space, but what next? We’re often asked by clients before a website
design project commences; ‘What is required?’ Therefore, we’ve decided to write
everything down in this handy guide making life much easier for you, our new
web design client, going forward. Below we have detailed exactly what you will
need. Helping you prepare to get started with the project, before work at our
end can commence.
No matter what stage you are at with your website design idea. You can use this
blog article as a great reference point. It’s worth noting that this is a general
guide we have written, not every concept in this article may apply to your
website design. But the majority certainly will, as most of the list are core
aspects of any website. However, it’s important to note that if you are having
your website designed by our good selves, the information that we detail here
will be required before we start building and designing your website.
If you aren’t yet at that stage, you might want to go back a step and check out
the post about gathering specifications and the goals of your new website. We’ve
also created a new more in depth post titled how to create requirements
documents which includes example templates that you can follow.
Website Design Requirements
Your idea and vision for the project is arguably the most important part of the
whole preparation process. Tell us about your idea! What purpose do you want
the website to serve?
It’s important to have everything in a clear structure that is easy for us to follow.
Your ideas and visions can be collated into documents or mood boards if you
like and provided as such to us by scanning and uploading to our Google Drive.
Colour Scheme
If you have a particular colour (or colour spectrum) that needs to be featured
throughout the website. You’ll need to specify this to us. We’ll require the 6-
digit hexadecimal colour code for the colour you want to use. We recommend
using the Hex colour picker website here Hex Colour Picker. For a website
design, we generally like to stick to a base of 3 or 4 colours at most. With 2 of
those colours generally being black or white. If you’ve read other articles on our
website you’ll already know that we are lovers of white space within a website
design. Allowing your content to take centre stage so to speak! The colour you
provide to us from the hex colour chart will generally be your brand colours. Or
the main colour that you want to be used through the theme of your website
design and other marketing material including your logo.
Fonts
Have you decided on specific fonts that you’d like to be used within the design
to depict your brands image? Just like colour, these fonts should be consistent
throughout all marketing materials as well as company logos to create a concise
brand identity.
Forming the nuts and bolts of your website so to speak is your websites content!
We’ve broken this concept up into a list of images, mock-ups, text wording
content and your logo. Depending on your website requirements what you will
need may differ, or you may need to provide us with more content. For example
these could include, videos, PDF or any other graphics that you require within
the design. Your mock-up provided should reference the file names of any
particular content you require within the website design.
We’ll let you into a little secret, eye-catching images that give an instant wow
factor are an integral part of any website design. If you have really strong and
powerful images, the design of your website will instantly look more impressive.
We would thoroughly recommend hiring a professional photographer where
possible. Providing us with the most high-resolution photos you can get your
hands on. It will really make a difference to the final design and help your
website stand out alongside your competitors.
Before your project commences we’ll have established how you’ll provide your
content to us via a shared access Google Drive folder. This is all part of
your website design project management plan which we will have put in place
and provided you with ahead of development. This is a requirement of all Primal
Space digital servicees.
Logo
If your logo is not being purchased through us, you’ll need to provide us with
this. The logo asset files should be provided as a .ai or .eps file type. Allowing
us to edit the logo’s design and size where required to fit within your websites
pages. The logo is often edited purely for the purpose of the website design.
If you don’t yet have a logo for your website, reach out to us for a quote for our
graphic design service. Allowing us to design a professional logo for your
business as part of the build.
Access to your Domain and Hosting
If your domain was not purchased through us here at Primal Space. And/or
you have your hosting with another company. For us to be able to implement
your website live, we’ll require login access to our domain and/or hosting
control panel to apply the settings. Even if you have your domain purchased
elsewhere. But you are having your website hosting supplied through ourselves
Primal Space. We’ll still need access to the domain settings to apply changes
there to point to the new website.
Animation is not just for cartoons anymore. From full-screen moving images to
small hover effects, touches of animation are popping up everywhere. Animation
is trendy, fun, and user-friendly.
One of the words that is almost synonymous with animation is Disney. In the
early 1980s, two of the companies’ top animators wrote a book detailing the 12
principles of animation. The “Illusion of Life: Disney Animation” by Frank
Thomas and Ollie Johnston still provides the framework for animation today.
To help guide your animation decisions, you might want to avoid some more
trendy elements and stick to some of the more timeless elements of animation
design. These techniques provide a basic guide that can help you create
something usable and visually interesting.
Straight forward and simple web pages are good but not the best. The
animation is the thing that brings life to a static page and makes it more
eye-catchy.
Here are a few ideas of animation for your web pages using the frontend
languages like HTML & CSS.
1. Rotating a Card: The first one is rotating a card. The card has two
things front side and the backside when we hover our mouse to the card
it will rotate 180 degrees and it will show the backside only.
Explanation: Here the first whole body is styled the image. The button
is styled according to your need and creativity. The main thing here is
the rotation at first the backside is hidden or rotated 180 degrees and
when we hover to the card the front side is rotating -180 degrees and the
backside is coming in the front.
Below is the example that illustrates the Rotating card animation.
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
2. Text Moving Up & Down: In this animation, the text will go up on hovering
the mouse to it, and in the case of mobile on click, the text will go up.
Explanation: At first, the down texts are being covered using the overflow is
hidden and bottom negative value. And when we are hovering into the card
the front text is going up using translate negative values and down text is
shown by making the bottom value as zero. Linear-gradient is used to read the
text clearly. Transition plays a big part as it makes things going smoothly. The
rest of the code is just for styling and for making things good.
3. Text Coming up on Hovering: In this animation text coming up on
hovering to the image and the image is zoomed.
Explanation: The first is to make the text disappear which is done by making
opacity zero. Now on hovering the image the image will be zoomed and the
overflow hidden property makes sure that the outer part of the image when it
is zoomed doesn’t go outside of the certain height and width. And on hovering
Bootstrap
Bootstrap is a free and open-source front end development framework for the
creation of websites and web apps. The Bootstrap framework is built
on HTML, CSS, and JavaScript (JS) to facilitate the development
of responsive, mobile-first sites and apps.
Responsive design makes it possible for a web page or app to detect the
visitor’s screen size and orientation and automatically adapt the display
accordingly; the mobile first approach assumes that smartphones, tablets and
task-specific Mobile apps are employees' primary tools for getting work done
and addresses the requirements of those technologies in design.
c. Easily Customizable
Despite the fact that Bootstrap is designed in responsive 12-column grids,
layouts, and components, it is also very easy to customize. Whether you need
a fixed grid or a responsive one, it can be made possible by making a few
changes. Offsetting and nesting of columns are also easy to do in both CPU-
based and mobile-based browser grids.
C. Components of Bootstrap
Some of the components that come pre-styled in Bootstrap are:
• Drop-downs
• Button
• Navigation
E. Bootstrap Templates
The readily available templates make it easier for inexperienced users to
create a website following a simple tutorial or demo available on the
Bootstrap.
Learning outcomes:
Resources
✓ Books.
✓ Computer. ✓ Papers.
✓ Pens.
✓ Markers.
✓ Pencils.
✓ Board.
• Facebook
• LinkedIn
• Twitter
• YouTube
• Pinterest
Naturally, you would like your website’s visitors to also visit these profiles and
consume the messages posted there. The best way to ensure this is to publish
social media buttons on your website landing pages, this gives visitors have the
ability to start following your accounts immediately, without even leaving your
website.
Their placement on your website is very important; there are certain locations
that individuals are used to looking, so you’ll want to be sure that their
placement is intuitive. Experts say the best places are either the top or bottom
navigation bar (or both!) or visibly separated from additional content along the
side of the homepage.
If you use a website development platform, social media icon integration is
incredibly easy, and can be set up in less than a minute, which means that
there’s no excuse not to have these icons integrated across your website.
Formative assessment
Written assessment
5. Duckett, J. (2011). HTML and CSS: design and build websites. John Wiley
& Sons.
6. Robbins, J. N. (2012). Learning web design: A beginner's guide to HTML,
CSS, JavaScript, and web graphics. O'Reilly Media, Inc.
7. Nixon, R. (2012). Learning PHP, MySQL, JavaScript, and CSS: A step-by-
step guide to creating dynamic websites. O'Reilly Media, Inc.
8. Goldstein, A., Lazaris, L., & Weyl, E. (2015). HTML5 & CSS3 for the Real
World. sitepoint.
9. Casario, M., Wormser, N., Saltzman, D., Bradford, A., Reid, J., Improta,
F., & Congleton, A. (2013). CSS3 Solutions: Essential Techniques for
CSS3 Developers. Apress.