Professional Documents
Culture Documents
• Basic html
• HTML (Hypertext Markup Language) is the primary building block of creating a website.
• Hyper Text Markup Language
• Hyper Text = “Text with links to other text. Documents written as hypertext contain text
that when "clicked on" by the user with a mouse, links to other documents. “
• Markup = The printer's marks that indicate how a document is to appear when published.
Sometimes also the editor's markings, or a graphical designer's marks to indicate
positioning, fonts, styles, etc. in a "comp."
• HTML is a very basic markup language and requires memorization of a few dozen HTML
commands that structure the look and layout of a web page.
• Before writing any HTML code or designing your first web page, you must decide on an
HTML editor or text editor, such as Notepad or WordPad.
• Tags tell Web browser how to display a page
• Can have either *.htm or *.html file extension
Select to Run your web site necessary browser
• Test your website in multiple browsers on multiple platforms.
• This is incredibly important, as different browsers may handle aspects
of your website differently.
• Before you begin promoting your website, try visiting and using your
website in the following browsers on Windows, Mac, iPhone, and
Android platforms:
• Google Chrome
• Firefox
• Safari (iPhone and Mac only)
• Microsoft Edge and Internet Explorer (Windows only)
• The built-in browser on several different Android phones (e.g.,
Samsung Galaxy, Google Nexus, etc.)
Continue…
• Step1. Determine whether you want to use a website creator.
• If you do decide to code your own website, you'll need to learn
both HTML and CSS coding.
• Step2. Map out your site.
• Your website's pages may be easier to visualize if you draw rough
pictures of each of them rather than just determining what
content should appear.
Continue….
• Use intuitive design.
• your website's basic design should follow established guidelines
such as the following:
• Navigation options (e.g., tabs for different pages) should go at the
top of the page.
• If you use a menu icon (☰), it should be in the top-left corner of
the page.
• If you use a search bar, it should be near the upper-right side of
the page.
• Helpful links (e.g., links to the "About" page or the "Contact Us"
page) should go at the very bottom of each page.
Continue…
Continue…
• Step4. Be consistent.
• Whatever text font, color palette, image theme, and design options
you choose, make sure that you use the same decision throughout
your website.
• if you exclusively use cool-tone colors for your site's home page,
don't implement bright, loud colors on the next page.
• Keep in mind that using loud or clashing colors, especially when
the colors display in a dynamic (e.g., moving) fashion, can evoke
epilepsy in a small number of web users.
A Web Page, Step by Step
• Step 1: Start with content. We add raw text content and see what
browsers do with it.
Step 2: Give the document structure. We learn about HTML
elements and its structure.
Step 3: Identify text elements. You’ll describe the content using the
appropriate text elements and learn about the proper way to use
HTML.
Step 4: Add an image. By adding an image to the page, we will
learn about attributes.
Step 5: Change the look with a style sheet. We learn formatting
content with CSS.
Start with Content
• Rules Naming Conventions
• It is important that you follow these rules and conventions when naming your files:
• Use proper suffixes for your files._ HTML files must end with .html (some servers allow .htm).
• Web graphics must be labeled according to their file format: .gif or .jpg (.jpeg is also acceptable).
• Never use character spaces within filenames.
• It is common to use an underline character or dash to visually separate words within filenames,
such as robbins_bio. html or robbins-bio.html.
• Avoid special characters such as?, %, #, /, :, ;, •, etc. Limit filenames to letters, numbers,
underscores, hyphens, and periods.
• Filenames may be case-sensitive, depending on your server configuration.
• Consistently using all lowercase letters in filenames, while not necessary, makes your filenames
easier to manage.
• Keep filenames short. Short names keep the character count and file size of your HTML file in
check.
What Browsers Ignore
• Example <p> <i>Write Your First Paragraph in italic text.</i></p>
• The HTML <em> tag is a logical element, which will display the enclosed
content in italic font, with added semantics importance.
• <p><em>This is an important content</em>, which displayed in italic font.</
p>
Cont…
•3) HTML Marked formatting
•If you want to mark or highlight a text, you should write the content within <mark>.........</mark>.
• <h2> I want to put a <mark> Mark</mark> on your face</h2>
•4) Underlined Text
•If you write anything within <u>.........</u> element, is shown in underlined text.
• <p> <u>Write Your First Paragraph in underlined text.</u></p>
•5) Strike Text
•Anything written within <strike>.......................</strike> element is displayed with strikethrough. It
is a thin line which cross the statement.
• example:
• <p> <strike>Write Your First Paragraph with strikethrough</strike>.</p>
Cont…
•6) Monospaced Font
•If you want that each letter has the same width then you should write the content within
<tt>.............</tt> element.
•Note: We know that most of the fonts are known as variable-width fonts because different
letters have different width. (for example: 'w' is wider than 'i'). Monospaced Font provides
similar space among every letter.
• <p>Hello <tt>Write Your First Paragraph in monospaced font.</tt></p>
•7) Superscript Text
•If you put the content within <sup>..............</sup> element, is shown in superscript; means it
is displayed half a character's height above the other characters.
• <p>Hello <sup>Write Your First Paragraph in superscript.</sup></p>
Cont…
•8) Subscript Text
•If you put the content within <sub>..............</sub> element, is shown in subscript ;
means it is displayed half a character's height below the other characters.
•<p>Hello <sub>Write Your First Paragraph in subscript.</sub></p>
•9) Deleted Text
•Anything that puts within <del>..........</del> is displayed as deleted text.
•<p>Hello <del>Delete your first paragraph.</del></p>
•10) Inserted Text
•Anything that puts within <ins>..........</ins> is displayed as inserted text.
•<p> <del>Delete your first paragraph.</del><ins>Write another paragraph.</ins></p>
Cont…
•11) Larger Text
•If you want to put your font size larger than the rest of the text then put the
content within <big>.........</big>. It increase one font size larger than the previous
one.
•<p>Hello <big>Write the paragraph in larger font.</big></p>
•12) Smaller Text
•If you want to put your font size smaller than the rest of the text then put the
content within <small>.........</small>tag. It reduces one font size than the previous
one.
•<p>Hello <small>Write the paragraph in smaller font.</small></p>
Give the Document Structure
• HTML Element Syntax
• An HTML element is an individual component of an HTML document. It
represents semantics, or meaning.
• Most HTML elements are written with a start tag (or opening tag) and an end
tag (or closing tag), with content in between.
• Tags surrounded by angle brackets < >
• Usually come in pairs
• Example: Start tag <p> and end tag </p>
• Stuff between is called “element content”
• Tags are not case sensitive
• New standard is to use lower case
Conti…
Continue…
• Empty HTML Elements
• Empty elements (also called self-closing or void elements) are not
container tags — that means, you can not write
Most HTML elements can contain any number of further elements (except empty elements), which are, in turn,
made up of tags, attributes, and content or other elements.
HTML Elements Types
• Elements can be placed in two distinct groups:
• block level and inline level elements. The former make up the
document's structure, while the latter dress up the contents of a
block.
• Also, a block element occupies 100% of the available width and it is
rendered with a line break before and after.
• Whereas, an inline element will take up only as much space as it
needs.
• The most commonly used block-level elements are
Continue…
• Whereas, the commonly used inline-level elements are
Comments are usually added with the purpose of making the source code easier to understand.
Comments are not displayed in the browser. An HTML comment begins with
• <body>…</body>
• Content of page
DOCTYPE
• A pre-processor directive at the top of the document tells the
browser what kind of standards apply to the document
• <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
Continue…
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>***replace this text with course & section number and your full name </title>
</head>
<body>
<!--Begin your content specification by adding your elements here. -->
</body>
</html>
Continue…
• <element attribute-name="value">Content</element> or for empty
elements:
• <element attribute-name="value" />
Continue…
• ISO 639-1 defines abbreviations for languages. In HTML, they can be
used in the lang attributes.
Language ISO Code
Chinese Zh
English En
French Fr
German De
Russian Ru
Local Languages
Afar Aa
Amharic Am
Afan Oromo Om
Somali So
Tigrinya Ti
Headings, <Hx> </Hx>
<HTML>
<HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
Heading 1
<BODY>
<H1> Heading 1 </H1> Heading 2
<H2> Heading 2 </H2> Heading 3
<H3> Heading 3 </H3>
Heading 4
<H4> Heading 4 </H4>
Heading 5
<H5> Heading 5 </H5>
Heading 6
<H6> Heading 6 </H6>
</BODY>
</HTML>
Break, <BR>
Line breaks allow you to decide where the text will break on a line or
continue to the end of the window.
A <BR> is an empty Element, meaning that it may contain attributes
but it does not contain content.
The <BR> element does not have a closing tag.
Horizontal Rule, <HR>
The <HR> element causes the browser to display
a horizontal line (rule) in your document.
<HR> does not use a closing tag, </HR>.
Cont…
Attribute Description Default Value
HTML
Hyper Text Markup Language
DOG
A human’s best friend!
Nesting Lists
You can nest lists by inserting a UL, OL, etc., inside a list item (LI).
EXample
<UL TYPE = “square”>
<LI> List item …</LI>
<LI> List item …
<OL TYPE=“i” START=“3”>
<LI> List item …</LI>
<LI> List item …</LI>
<LI> List item …</LI>
<LI> List item …</LI>
<LI> List item …</LI>
</OL>
</LI>
<LI> List item …</LI>
</UL>
Exercise
Cont…
• <H1 ALIGN="CENTER">SAFETY TIPS FOR CANOEISTS</H1>
<OL TYPE=“a” START=“2”>
<LI>Be able to swim </LI>
<LI>Wear a life jacket at all times </LI>
<LI>Don't stand up or move around. If canoe tips,
• <UL>
<LI>Hang on to the canoe </LI>
<LI>Use the canoe for support and </LI>
<LI>Swim to shore
</UL> </LI>
• <LI>Don't overexert yourself </LI>
<LI>Use a bow light at night </LI>
</OL>
Images
<IMG>This element defines a graphic image on the page.
Image File (SRC:source): This value will be a URL (location of the
image) E.g. http://www.domain.com/dir/file.ext or /dir/file.txt.
Alternate Text (ALT): This is a text field that describes an image or
acts as a label. It is displayed when they position the cursor over a
graphic image.
Alignment (ALIGN): This allows you to align the image on your page.
Cont..
Width (WIDTH): is the width of the image in pixels.
Height (HEIGHT): is the height of the image in pixels.
Border (BORDER): is for a border around the image, specified in pixels.
HSPACE: is for Horizontal Space on both sides of the image specified in
pixels. A setting of 5 will put 5 pixels of invisible space on both sides of the
image.
VSPACE: is for Vertical Space on top and bottom of the image specified in
pixels. A setting of 5 will put 5 pixels of invisible space above and bellow
the image.
Cont…
1) <IMG SRC=“jordan.gif“ border=4>
2) <IMG SRC=" jordan.gif" width="60" height="60">
3) <IMG SRC=“jordan.gif" ALT="This is a text that goes with the image">
4) <IMG SRC=" jordan.gif “ Hspace="30" Vspace="10" border=20>
5) < IMG SRC =" jordan.gif“ align="left">
blast blast blast blast blast
Lab section exercise 1
create a web page for the following information.
THE DESIGN PRINCIPLES
The design principles adopted in the curricula design are the capillary approach, the
adoption of a web-centric solution as the basis for the mediating process and a highly
flexible implementation approach which corresponds to an intensive use of multimedia,
ICT resources and multiple content formats.
Coding Is a Valuable Job skill
Coding is the skill of the 21st century. Jobs today require more problem-solving ability
than ever before, and more and more careers involve technology as an integral
requirement.
The Body Element
• The BODY element of a web page is an important element in regards to
the page’s appearance. Here are the attributes of the BODY tag to
control all the levels:
TEXT="#RRGGBB" to change the color of all the text on the page (full
page text color.)
This element contains information about the page’s background color,
the background image, as well as the text and link colors.
Background Color
It is very common to see web pages with their background color set to
white or some other colors.
To set your document’s background color, you need to edit the <BODY>
element by adding the BGCOLOR attribute. The following example will
display a document with a white background color:
<BODY BGCOLOR=“#FFFFFF”></BODY>
TEXT Color
The TEXT attribute is used to control the color of all the normal text in
the document. The default color for text is black. The TEXT attribute
would be added as follows:
<BODY BGCOLOR=“#FFFFFF” TEXT=“#FF0000”></BODY>
In this example the document’s page
color is white and the text would be red.
LINK, VLINK, and ALINK
These attributes control the colors of the different link states:
1. LINK – initial appearance – default = Blue.
2. VLINK – visited link – default = Purple.
3. ALINK –active link being clicked–default= Yellow.
The Format for setting these attributes is:
<BODY BGCOLOR=“#FFFFFF” TEXT=“#FF0000” LINK=“#0000FF”
VLINK=“#FF00FF”
ALINK=“FFFF00”> </BODY>
Using Image Background
The BODY element also gives you ability of setting an image as the
document’s background.
An example of a background image’s HTML code is as follows:
Row 1 Col 1
Row 2 Col 2
Row 2 Col 1
Row 3 Col 2
Special Things to Note
• TH, TD and TR should always have end tags.
Although the end tags are formally optional, many browsers will mess up the
formatting of the table if you omit the end tags. In particular, you should always
use end tags if you have a TABLE within a TABLE -- in this situation, the table parser
gets hopelessly confused if you don't close your TH, TD and TR elements.
• A default TABLE has no borders
By default, tables are drawn without border lines. You need the BORDER attribute
to draw the lines.
• By default, a table is flush with the left margin
TABLEs are plopped over on the left margin. If you want centered tables, You can
either: place the table inside a DIV element with attribute ALIGN="center".
Most current browsers also supports table alignment, using the ALIGN attribute.
Allowed values are "left", "right", or "center", for example: <TABLE ALIGN="left">.
The values "left" and "right" float the table to the left or right of the page, with text
flow allowed around the table. This is entirely equivalent to IMG alignment
What will be the output?
Doc1.html Doc2.html
Doc1.html Doc2.html
Frames.html
Frame Page Architecture
A <FRAMESET> element is placed in the html document before the
<BODY> element. The <FRAMESET> describes the amount of screen
real estate given to each windowpane by dividing the screen into
ROWS or COLS.
The <FRAMESET> will then contain <FRAME> elements, one per
division of the browser window.
Note: Because there is no BODY container, FRAMESET pages can't
have background images and background colors associated with them.
Cont…
<HTML>
<HEAD>
<TITLE> Framed Page </TITLE>
<FRAMeSET COLS=“23%,77%”>
<FRAME SRC=“Doc1.html”>
<FRAME SRC=“Doc2.html”>
</FRAMeSET >
</HEAD>
</HTML>
The Diagram below is a graphical view of
the document described above
NAME= NAME=right_pane
left_pane SRC= Doc2.html
SRC=Doc1.h
tml
<FRAMESET> Container
<FRAMESET> : The FRAMESET element creates divisions in the
browser window in a single direction. This allows you to define
divisions as either rows or columns.
ROWS : Determines the size and number of rectangular rows
within a <FRAMESET>. They are set from top of the display
area to the bottom.
Possible values are:
Absolute pixel units, I.e. “360,120”.
A percentage of screen height, e.g. “75%,25%”.
Proportional values using the asterisk (*). This is often
combined with a value in pixels , e.g. “360,*”.
<Frameset cols=“200,20%,*,2*”>
Creating a Frames Page
COLS: Determines the size and number of rectangular
columns within a <FRAMESET>. They are set from left
to right of the display area.
<HTML>
<HEAD>
<TITLE> Framed Page </TITLE>
</HEAD>
Cont…
<FRAMESET COLS="23%,77%">
<FRAME SRC="" NAME="left_pane“>
<FRAME SRC="" NAME="right_pane">
<NOFRAMES>
<P> This is a Framed Page. Upgrade your browser to
support frames.</P>
</NOFRAMES></FRAMESET>
Compound FRAMESET Divisions
In this case a second FRAMESET element will be inserted in the place
of the FRAME element that would describe the second row.
The second FRAMESET element will divide the remaining screen real
estate into 2 columns.
This nested FRAMESET will then be followed by 2 FRAME elements to
describe each of the subsequent frame divisions created.
Example
<html> <noframes>
<head>
<p>
<title> Compound Frames Page</title>
</head> Default message
<frameset rows=“120,*”> </p>
<frame src=“banner_file.html” </noframes>
name”banner”>
<frameset cols=“120,*”>
</frameset>
<frame src=“links_file.html” name=“links”> </frameset>
<frame src=“content_file.html”
name=“content”>
</head>
Cont…
Banner File
Links
File Contents File
Cont…
<HEAD>
<FRAMESET ROWS="25%,50%,25%”
<FRAME SRC="">
<FRAMESET COLS="25%,*">
<FRAME SRC="">
<FRAME SRC="">
</FRAMESET>
<FRAME SRC="">
</FRAMESET>
</HEAD>
95
96
Frame Formatting
• Example:
99
Targets
When you use links for use in a frames environment you will
need to specify an additional attribute called TARGET.
The TARGET attribute uses the NAME attribute of the FRAME
element.
If we were to place a link in doc1.html that linked to doc3.html
and we wanted doc3.html to be displayed in the right
windowpane; the HTML code would appear in doc1.html as
follows:
3. TARGET=“_self” : Loads the document in the same window where the anchor was
{Clicked}. This is the default setting for linking elements.
4. TARGET=“_parent” : the _parent frame is a prior frameset that the current frameset
was “spawned” from. If there isn’t one it is the browser window. The document is
loaded into the area occupied by the columns or rows frameset containing the frame
that contains the link. The back is turned on. All windows disappear.
If a frame contains the following link, then clicking the link
launches a new, unnamed browser display window that contains
the content defined in stuff.HTM. This can be a simple HTML
document, or an entirely new FRAMESET definition.
1. <A HREF="stuff.html" TARGET="_blank">
If a frame contains the following link, then clicking the link will
simply cause the frame which contains the link to clear, and its
content will be replaced with whatever is in stuff.htm.
2. <A HREF="stuff.html" TARGET="_self">
If a frame contains the following link, the frameset that contains
the frame that contains this link will be replaced by stuff.HTM.
3. <A HREF="stuff.html" TARGET="_parent">
Finally, if a frame contains the following link, clicking the link
replaces the entire browser window with the contents of
stuff.HTM.
4. <A HREF="stuff.html" TARGET="_top">
Targeting links to frames
The TARGET attribute allows you to specify the frame into which a page is to be
loaded into in a frames setting.
Parent window
The TARGET attribute allows you to specify the frame into which a page is to be
loaded into in a frames setting.
chap2.html
chap3.html
Forms
• Forms add the ability to web pages to not only provide the person
viewing the document with dynamic information but also to obtain
information from the person viewing it, and process the information.
• To insert a form we use the <FORM></FORM> tags. The rest of the
form elements must be inserted in between the form tags.
<HTML> <HEAD>
<TITLE> Sample Form</TITLE>
</HEAD>
<BODY BGCOLOR=“FFFFFF”>
<FORM ACTION = “”>
<P> First Name: <INPUT TYPE=“TEXT” NAME=“fname” MAXLENGTH=“50”> </P>
<P> <INPUT TYPE=“SUBMIT” NAME=“fsubmit1” VALUE=“Send Info”> </P>
</FORM>
</BODY> </HTML>
<FORM> element attributes
ACTION: is the URL of the CGI (Common Gateway Interface) program
that is going to accept the data from the form, process it, and send a
response back to the browser.
METHOD: GET (default) or POST specifies which HTTP method will be
used to send the form’s contents to the web server. The CGI
application should be written to accept the data from either method.
NAME: is a form name used by VBScript or
JavaScripts.
TARGET: is the target frame where the response page will show up.
Form Elements
Form elements have properties: Text boxes, Password boxes,
Checkboxes, Option(Radio) buttons, Submit, Reset, File, Hidden and
Image.
The properties are specified in the TYPE Attribute of the HTML element
<INPUT></INPUT>.
Form Elements
<INPUT> Element’s Properties
TYPE= Type of INPUT entry field.
NAME = Variable name passed to CGI application
VALUE= The data associated with the variable
name to be passed to the CGI application
CHECKED= Button/box checked
SIZE= Number of visible characters in text field
MAXLENGHT= Maximum number of characters
accepted.
Text Box
Text boxes: Used to provide input fields for text, phone numbers, dates, etc.
<INPUT TYPE= " TEXT " >
Browser will display
Textboxes use the following attributes:
TYPE: text.
SIZE: determines the size of the textbox in characters. Default=20 characters.
MAXLENGHT : determines the maximum number of characters that the field will
accept.
NAME: is the name of the variable to be sent to the CGI application.
VALUE: will display its contents as the default value.
Example on Text Box
<TITLE>Form_Text_Type</TITLE>
</HEAD> <BODY>
<h1> <font color=blue>Please enter the following bioData</font></h1>
<FORM name="fome1" Method= " get " Action= " URL " >
First Name: <INPUT TYPE="TEXT" NAME="FName"
SIZE="15" MAXLENGTH="25"><BR>
Last Name: <INPUT TYPE="TEXT" NAME="LName"
SIZE="15" MAXLENGTH="25"><BR>
Nationality: <INPUT TYPE="TEXT" NAME="Country"
SIZE="25" MAXLENGTH="25"><BR>
The Phone Number: <INPUT TYPE="TEXT" NAME="Phone"
SIZE="15" MAXLENGTH="12"><BR>
</FORM> </BODY> </HTML>
Output
Password
Password: Used to allow entry of passwords.
<INPUT TYPE= " PASSWORD " >
Browser will display
Text typed in a password box is starred out in the browser
display.
Password boxes use the following attributes:
TYPE: password.
SIZE: determines the size of the textbox in characters.
MAXLENGHT: determines the maximum size of the password in characters.
NAME: is the name of the variable to be sent to the CGI application.
VALUE: is usually blank.
Example on Password Box
<HTML><HEAD>
<TITLE>Form_Password_Type</TITLE></HEAD>
<BODY>
<h1> <font color=red>To Access, Please
enter:</font></h1>
<FORM name="fome2" Action="url" method="get">
User Name: <INPUT TYPE="TEXT" Name="FName"
SIZE="15" MAXLENGTH="25"><BR>
Password: <INPUT TYPE="PASSWORD"
NAME="PWord" value="" SIZE="15”
MAXLENGTH="25"><BR>
</FORM></BODY> </HTML>
Output
Hidden
Hidden: Used to send data to the CGI application that you don’t want the
web surfer to see, change or have to enter but is necessary for the
application to process the form correctly.
<INPUT TYPE=“HIDDEN”>
Nothing is displayed in the browser.
Hidden inputs have the following attributes:
TYPE: hidden.
NAME: is the name of the variable to be sent to the CGI application.
VALUE: is usually set a value expected by the CGI application.
Check Box
Check Box: Check boxes allow the users to select more than one option.
<INPUT TYPE=“CHECKBOX”>
Browser will display
• <INPUT TYPE=“RESET”>