0% found this document useful (0 votes)
9 views22 pages

Website Design

The document provides an overview of website design, including definitions of websites and web pages, the principles of good design, and the importance of HTML in web development. It outlines key design principles such as contrast, repetition, alignment, and proximity, as well as essential factors for effective web design. Additionally, it explains HTML structure, tags, attributes, and the significance of proper formatting in creating user-friendly web pages.

Uploaded by

xaviezadarpro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views22 pages

Website Design

The document provides an overview of website design, including definitions of websites and web pages, the principles of good design, and the importance of HTML in web development. It outlines key design principles such as contrast, repetition, alignment, and proximity, as well as essential factors for effective web design. Additionally, it explains HTML structure, tags, attributes, and the significance of proper formatting in creating user-friendly web pages.

Uploaded by

xaviezadarpro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 22

19.

0 WEBSITE DESIGN
19.1 Introduction

A website, also written as Web site, web site, or simply site, is a set of related web pages containing content such
as text, images, video, audio, etc. A website is hosted on at least one web server, accessible via a network such as
the Internet or a private local area network through an Internet address known as a Uniform Resource Locator. All
publicly accessible websites collectively constitute the World Wide Web.A webpage is a document, typically
written in plain text interspersed with formatting instructions of Hypertext Markup Language (HTML, XHTML). A
webpage may incorporate elements from other websites with suitable markup anchors.

Webpages are accessed and transported with the Hypertext Transfer Protocol (HTTP), which may optionally employ
encryption (HTTP Secure, HTTPS) to provide security and privacy for the user of the webpage content. The user's
application, often a web browser, renders the page content according to its HTML markup instructions onto a
display terminal.The pages of a website can usually be accessed from a simple Uniform Resource Locator (URL)
called the web address. The URLs of the pages organize them into a hierarchy, although hyperlinking between them
conveys the reader's perceived site structure and guides the reader's navigation of the site which generally includes a
home page with most of the links to the site's web content, and a supplementary about, contact and link page.

Web design is a broad term covering many different skills and disciplines that are used in the production and
maintenance of websites. The different areas of web design include; web graphic design, interface design, authoring;
including standardized code and proprietary software, user experience design and search engine optimization

Four Principles of Good Design for Websites

The four major design principles include: contrast, repetition, alignment, and proximity.

Contrast

Great contrast can leave a very good first impression on a user. Without a focal point, the viewer is generally lost in
a sea of equally-sized elements and typography. It’s the designer’s job to create visual elements of significance
that guide the user’s experience. You can achieve great contrast on your site by choosing your images, colors and
fonts wisely.

Repetition

Repetition in print design is much more common than it is in web design; however it can be equally effective.
Repeating design elements helps create a consistent look and improves branding. In web design a great way to
achieve this is by repeating elements in the header and footer. Check out an example below.

Alignment

Alignment plays an intricate role in taking your site designs from looking amateur to professional. I’ve recently
become a huge advocate for designing sites using a grid. Doing so cleans up your designs and gives you an awesome
framework to work from.

Proximity

The last principle is proximity. This has to do with grouping like elements together and separating those that are not.
It can really ruin user experience if you group everything into one lump text block. That’s why its very important to
use header tags and proper spacing.
Essential Factors to Consider When Designing a Website

Appearance is the first thing that makes an impression.

The first thing we notice when we come across anything is the ambiance that is why the design of a web page is so
important. From the beginning, web design trends have evolved and followed changes in technology and
consumerism.

Gadgets like iPhones, iPods, touch screen cell phones and note books are some of the highlights of the fast
development in this world. Social websites are the new trend in the world of web design. People have higher
demands and shorter attention spans, in order for a site to be effective it either has to be, or at least appear, effortless
and usable. Along with these rapid developments, the essence of web designing is also groomed.

Psychological Effect

It’s very easy to find information of almost any kind on the internet. According to psychological studies, humans
naturally accept those thing that are relevant to their real life, rather than fantastical or imaginary things. Based on
this theory, the following points should be kept in mind when designing websites.

Simplicity

Some scholars say the difference between a successful and an unsuccessful website lies in its simplicity.“Design is
done for a reason, and if you do it well it will prosper. If you do it poorly, people will leave your website.”Here are
some good examples of websites that showcase usability:

“KISS- Keep It Simple, Smart! Or Keep It Simple and Straightforward” is at the core of a lot of great design.

Benefits of Internet Web Sites

1. There are many benefits of the use of Web. Different types of organizations use the Web for different
purposes.
2. The major benefits of Internet web sites are:

3. A manufacturer provides you the information about its products, prices and where they are available for
sale.

4. A shop provides you a list of goods available, price of each item.

5. An airport provides you the latest information about flights arriving and / or leaving the airport.

6. A television station provides you the information about its programs, the latest news etc.

7. Newspapers provide the up-to-date or latest news.

8. An encyclopedia publisher provides on-line facility to access or search any information on any topic in the
world.

9. The weather forecasting departments of each country provide the latest forecasts of their countries.

10. A writer (author) provides you a list of his books, which are published or in print.

11. Film Actors/Actresses and sportsmen provide their introduction with pictures.

12. Search engines provide you a facility to search different information or other sites on the Internet.
13. Medical sites on the Internet provide information about diseases. These sites also let you consult a panel of
doctors on-line who will advise you about any medical problem.

14. Online education web sites who taught about technology like free-computer-tips.info

19.2 HTML (Hypertext Markup Language)

HTML stands for HyperText Markup Language, which is developed based on the SGML (Standard Generalized
Markup Language). More information concerning HTML and SGML can be obtained from the World Wide Web
Consortium (W3C).

HTML is a language for describing web pages.

HTML stands for Hyper Text Markup Language

HTML is not a programming language, it is a markup language

A markup language is a set of markup tags

HTML uses markup tags to describe web pages

19.2 .1 HTML Tags

HTML uses tags to "mark" certain text with a particular behavior. For the example statement below,

<B>This is bold text</B>

will appear in a Web browser as

This is bold text

The <B>and </B> tags mark the enclosed text (i.e., This is bold text) as bold type.

There are two basic types of HTML Tags: containers and empty tags.

Containers have an opening tag (e.g., the <B> tag) and a closing tag (e.g., the </B> tag). Usually, the closing tag
has the same keyword as the opening tag, but starts with a back slash '/'.

Empty tags consist of a single tag only (e.g., the <BR> tag).

HTML markup tags are usually called HTML tags

HTML tags are keywords surrounded by angle brackets like <html>

HTML tags normally come in pairs like <b> and </b>

The first tag in a pair is the start tag, the second tag is the end tag

Start and end tags are also called opening tags and closing tags

HTML Documents = Web Pages


Although HTML documents include the .htm or .html extensions, they are simply ASCII text files, and can be
edited by any text editor (e.g., Notepad) or word processor (e.g., Microsoft Word).

HTML documents describe web pages

HTML documents contain HTML tags and plain text

HTML documents are also called web pages

The purpose of a web browser (like Internet Explorer or Firefox) is to read HTML documents and display them as
web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page:

<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>
Example Explained

The text between <html> and </html> describes the web page

The text between <body> and </body> is the visible page content

The text between <h1> and </h1> is displayed as a heading

The text between <p> and </p> is displayed as a paragraph

19.2.2 Editing HTML

HTML can be written and edited using many different editors like Dreamweaver and Visual Studio.

However, in this tutorial we use a plain text editor (like Notepad) to edit HTML. We believe using a plain text editor
is the best way to learn HTML.

.HTM or .HTML File Extension

When you save an HTML file, you can use either the .htm or the .html file extension. There is no difference; it is
entirely up to you.

HTML Headings

Headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading.

Example
< h1>This is a heading</h1>
< h2>This is a heading</h2>
< h3>This is a heading</h3>

Note: Browsers automatically add some empty space (a margin) before and after each heading.

Headings Are Important

Use HTML headings for headings only. Don't use headings to make text BIG or bold.

Search engines use your headings to index the structure and content of your web pages.

Since users may skim your pages by its headings, it is important to use headings to show the document structure.

H1 headings should be used as main headings, followed by H2 headings, then the less important H3 headings, and
so on.

HTML Paragraphs

HTML paragraphs are defined with the <p> tag.

Example

< p>This is a paragraph.</p>


< p>This is another paragraph.</p>
HTML Lines

The <hr /> tag creates a horizontal line in an HTML page. The hr element can be used to separate content:

Example

< p>This is a paragraph</p>


< hr />
< p>This is a paragraph</p>
< hr />
< p>This is a paragraph</p>
HTML Links

HTML links are defined with the <a> tag.

Example

< a href="http://www.w3schools.com">This is a link</a>

Note: The link address is specified in the href attribute.

HTML Images

HTML images are defined with the <img> tag.

Example

< img src="w3schools.jpg" width="104" height="142" />


Note: The name and the size of the image are provided as attributes.

HTML Elements

An HTML element is everything from the start tag to the end tag:

Start tag * Element content End tag *


<p> This is a paragraph </p>
<a href="default.htm" > This is a link </a>
<br />

* The start tag is often called the opening tag. The end tag is often called the closing tag.

HTML Element Syntax

An HTML element starts with a start tag / opening tag

An HTML element ends with an end tag / closing tag

The element content is everything between the start and the end tag

Some HTML elements have empty content

Empty elements are closed in the start tag

Most HTML elements can have attributes

Nested HTML Elements

Most HTML elements can be nested (can contain other HTML elements).

HTML documents consist of nested HTML elements.

HTML Document Example

< html>

< body>
< p>This is my first paragraph.</p>
< /body>

< /html>

The example above contains 3 HTML elements. HTML Example Explained

The <p> element:

< p>This is my first paragraph.</p>


The <p> element defines a paragraph in the HTML document.
The element has a start tag <p> and an end tag </p>.
The element content is: This is my first paragraph.

The <body> element:

< body>
< p>This is my first paragraph.</p>
< /body>

The <body> element defines the body of the HTML document.


The element has a start tag <body> and an end tag </body>.
The element content is another HTML element (a p element).

The <html> element:

< html>

< body>
< p>This is my first paragraph.</p>
< /body>

< /html>

The <html> element defines the whole HTML document.


The element has a start tag <html> and an end tag </html>.
The element content is another HTML element (the body element).

Don't Forget the End Tag

Some HTML elements might display correctly even if you forget the end tag:

< p>This is a paragraph


< p>This is a paragraph

The example above works in most browsers, because the closing tag is considered optional.

Many HTML elements will produce unexpected results and/or errors if you forget the end tag.

Empty HTML Elements

HTML elements with no content are called empty elements.

<br> is an empty element without a closing tag (the <br> tag defines a line break).

In XHTML, all elements must be closed. Adding a slash inside the start tag, like <br />, is the proper way of closing
empty elements in XHTML (and XML).

Use Lowercase Tags

HTML tags are not case sensitive: <P> means the same as <p>. Many web sites use uppercase HTML tags.
HTML Attributes

HTML elements can have attributes. Attributes provide additional information about an element.

Attributes are always specified in the start tag

Attributes come in name/value pairs like: name="value"

Attribute Example

HTML links are defined with the <a> tag. The link address is specified in the href attribute:

Example

< a href="http://www.w3schools.com">This is a link</a>


Always Quote Attribute Values

Attribute values should always be enclosed in quotes.

Double style quotes are the most common, but single style quotes are also allowed.

In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes:
name='John "ShotGun" Nelson'

19.2.3 HTML Attributes Reference

A complete list of legal attributes for each HTML element is listed in our:

Below is a list of some attributes that are standard for most HTML elements:

Attribute Value Description


Class Classname Specifies a classname for an element
Id Id Specifies a unique id for an element
Style style_definition Specifies an inline style for an element
Title tooltip_text Specifies extra information about an element
(displayed as a tool tip)
HTML Comments

Comments can be inserted into the HTML code to make it more readable and understandable. Comments are
ignored by the browser and are not displayed.

Comments are written like this:

Example

< !-- This is a comment -->

Note: There is an exclamation point after the opening bracket, but not before the closing bracket.

19.2.4 How to View HTML Source


Have you ever seen a Web page and wondered "Hey! How did they do that?"

To find out, right-click in the page and select "View Source" (IE) or "View Page Source" (Firefox), or similar for
other browsers. This will open a window containing the HTML code of the page.

HTML Tag Reference

Tag Description
<html> Defines an HTML document
<body> Defines the document's body
<h1> to <h6> Defines HTML headings
<hr /> Defines a horizontal line
<!--> Defines a comment
HTML Paragraphs

HTML documents are divided into paragraphs. Paragraphs are defined with the <p> tag.

Example

< p>this is a paragraph</p>


< p>this is another paragraph</p>

Example

< p>this is a paragraph


< p>this is another paragraph

The example above will work in most browsers, but don't rely on it. Forgetting the end tag can produce unexpected
results or errors.

Note: Future version of HTML will not allow you to skip end tags.

HTML Line Breaks

Use the <br /> tag if you want a line break (a new line) without starting a new paragraph:

Example

< p>this is<br />a para<br />graph with line breaks</p>

The <br /> element is an empty HTML element. It has no end tag.

<br> or <br />

In XHTML, XML, elements with no end tag (closing tag) are not allowed.

Even if <br> works in all browsers, writing <br /> instead works better in XHTML and XML applications.

HTML Output
You cannot be sure how HTML will be displayed. Large or small screens and resized windows will create different
results.

With HTML, you cannot change the output by adding extra spaces or extra lines in your HTML code.

The browser will remove extra spaces and extra lines when the page is displayed. Any number of lines counts as one
line, and any number of spaces count as one space.

HTML Tag Reference

W3Schools' tag reference contains additional information about HTML elements and their attributes.

Tag Description

<p> Defines a paragraph

<br /> Inserts a single line break

19.2.4 HTML Text Formatting

This text is bold

This text is big

This text is italic

This is computer output

This is subscript and superscript

HTML Formatting Tags

HTML uses tags like <b> and <i> for formatting output, like bold or italictext.

These HTML tags are called formatting tags (look at the bottom of this page for a complete reference).

Often <strong> renders as <b>, and <em> renders as <i>.

However, there is a difference in the meaning of these tags:

< b> or <i> defines bold or italic text only.

< strong> or <em> means that you want the text to be rendered in a way that the user understands as "important".
Today, all major browsers render strong as bold and em as italics. However, if a browser one day wants to make a
text highlighted with the strong feature, it might be cursive for example and not bold!

HTML Text Formatting Tags

Tag Description

<b> Defines bold text

<big> Defines big text


<em> Defines emphasized text

<i> Defines italic text

<small> Defines small text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<ins> Defines inserted text

<del> Defines deleted text

HTML "Computer Output" Tags

Tag Description

<code> Defines computer code text

<kbd> Defines keyboard text

<samp> Defines sample computer code

<tt> Defines teletype text

<var> Defines a variable

<pre> Defines preformatted text

HTML Citations, Quotations, and Definition Tags

Tag Description

<abbr> Defines an abbreviation

<acronym> Defines an acronym

<address> Defines contact information for the author/owner of a document

<bdo> Defines the text direction

<blockquote> Defines a long quotation

<q> Defines a short quotation

<cite> Defines a citation

<dfn> Defines a definition term


19.2.5 HTML Fonts

The HTML <font> Tag Should NOT be used

The <font> tag is deprecated in HTML 4, and removed from HTML5.

The World Wide Web Consortium (W3C) has removed the <font> tag from its recommendations.

In HTML 4, style sheets (CSS) should be used to define the layout and display properties for many HTML elements.

The example below shows how the HTML could look by using the <font> tag:

Example

< p>
< font size="5" face="arial" color="red">
This paragraph is in Arial, size 5, and in red text color.
< /font>
< /p>

< p>
< font size="3" face="verdana" color="blue">
This paragraph is in Verdana, size 3, and in blue text color.
< /font>
< /p>

19.2.6 HTML Tables

Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into
data cells (with the <td> tag). td stands for "table data," and holds the content of a data cell. A <td> tag can contain
text, links, images, lists, forms, other tables, etc.

Table Example

< table border="1">


< tr>
< td>row 1, cell 1</td>
< td>row 1, cell 2</td>
< /tr>
< tr>
< td>row 2, cell 1</td>
< td>row 2, cell 2</td>
< /tr>
< /table>

How the HTML code above looks in a browser:

row 1, cell 1 row 1, cell 2


row 2, cell 1 row 2, cell 2
HTML Tables and the Border Attribute

If you do not specify a border attribute, the table will be displayed without borders. Sometimes this can be useful,
but most of the time, we want the borders to show.
To display a table with borders, specify the border attribute:

< table border="1">


< tr>
< td>Row 1, cell 1</td>
< td>Row 1, cell 2</td>
< /tr>
< /table>
HTML Table Headers

Header information in a table is defined with the <th> tag.

All major browsers display the text in the <th> element as bold and centered.

< table border="1">


< tr>
< th>Header 1</th>
< th>Header 2</th>
< /tr>
< tr>
< td>row 1, cell 1</td>
< td>row 1, cell 2</td>
< /tr>
< tr>
< td>row 2, cell 1</td>
< td>row 2, cell 2</td>
< /tr>
< /table>

How the HTML code above looks in your browser:

Header 1 Header 2
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2
HTML Table Tags caption

Tag Description
<table> Defines a table
<th> Defines a table header
<tr> Defines a table row
<td> Defines a table cell
<caption> Defines a table caption
<colgroup> Defines a group of columns in a table, for formatting
<col /> Defines attribute values for one or more columns in a table
<thead> Groups the header content in a table
<tbody> Groups the body content in a table
<tfoot> Groups the footer content in a table
19.2.8 HTML Lists

The most common HTML lists are ordered and unordered lists:
An ordered list: An unordered list:

The first list item List item

The second list item List item

The third list item List item

HTML Unordered Lists

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.

The list items are marked with bullets (typically small black circles).

< ul>
< li>Coffee</li>
< li>Milk</li>
< /ul>

How the HTML code above looks in a browser:

Coffee

Milk

HTML Ordered Lists

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.

The list items are marked with numbers.

< ol>
< li>Coffee</li>
< li>Milk</li>
< /ol>

How the HTML code above looks in a browser:

Coffee

Milk

HTML Definition Lists

A definition list is a list of items, with a description of each item.

The <dl> tag defines a definition list.

The <dl> tag is used in conjunction with <dt> (defines the item in the list) and <dd> (describes the item in the list):

<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>

How the HTML code above looks in a browser:

Coffee

- black hot drink

Milk

- white cold drink

HTML List Tags

Tag Description
<ol> Defines an ordered list
<ul> Defines an unordered list
<li> Defines a list item
<dl> Defines a definition list
<dt> Defines an item in a definition list
<dd> Defines a description of an item in a definition list
HTML <div> and <span>

HTML elements can be grouped together with <div> and <span>

HTML Block Elements

Most HTML elements are defined as block level elements or asinline elements.

Block level elements normally start (and end) with a new line when displayed in a browser.

Examples: <h1>, <p>, <ul>, <table>

HTML Inline Elements

Inline elements are normally displayed without starting a new line.

Examples: <b>, <td>, <a>, <img>

The HTML <div> Element

The HTML <div> element is a block level element that can be used as a container for grouping other HTML
elements.

The <div> element has no special meaning. Except that, because it is a block level element, the browser will display
a line break before and after it.

When used together with CSS, the <div> element can be used to set style attributes to large blocks of content.
Another common use of the <div> element, is for document layout. It replaces the "old way" of defining layout
using tables. Using tables is not the correct use of the <table> element. The purpose of the <table> element is to
display tabular data.

The HTML <span> Element

The HTML <span> element is an inline element that can be used as a container for text.

The <span> element has no special meaning.

When used together with CSS, the <span> element can be used to set style attributes to parts of the text.

HTML Grouping Tags

Tag Description

<div> Defines a div

<span> Defines a span

19.2.9 HTML Layouts

Web page layout is very important to make your website look good.

Design your webpage layout very carefully.

19.3 Website Layouts

Most websites have put their content in multiple columns (formatted like a magazine or newspaper).

Multiple columns are created by using <div> or <table> elements. CSS are used to position elements, or to create
backgrounds or colorful look for the pages.

HTML Layouts - Using <div> Elements

The div element is a block level element used for grouping HTML elements.

The following example uses five div elements to create a multiple column layout, creating the same result as in the
previous example:

Example

<!DOCTYPE html>
<html>
<body>
<div id="container" style="width:500px">
<div id="header" style="background-color:#FFA500;">
<h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>
<div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
< b>Menu</b><br />
HTML<br />
CSS<br />
JavaScript</div>

< div id="content" style="background-color:#EEEEEE;height:200px;width:400px;float:left;">


Content goes here</div>

< div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">


Copyright © W3Schools.com</div>

< /div>

< /body>
< /html>
HTML Layouts - Using Tables

A simple way of creating layouts is by using the HTML <table> tag. Multiple columns are created by using <div> or
<table> elements. CSS are used to position elements, or to create backgrounds or colorful look for the pages.

The following example uses a table with 3 rows and 2 columns - the first and last row spans both columns using the
colspan attribute:

Example

<!DOCTYPE html>
<html>
<body>

<table width="500" border="0">


<tr>
<td colspan="2" style="background-color:#FFA500;">
<h1>Main Title of Web Page</h1>
</td>
</tr>

<tr valign="top">
<td style="background-color:#FFD700;width:100px;text-align:top;">
<b>Menu</b><br/>
HTML<br />
CSS<br />
JavaScript
</td>
<td style="background-color:#EEEEEE;height:200px;width:400px;text-align:top;">
Content goes here</td>
</tr>
<tr>
<td colspan="2" style="background-color:#FFA500;text-align:center;">
Copyright © W3Schools.com</td>
</tr>
</table>

</body>
</html>

The biggest advantage of using CSS is that, if you place the CSS code in an external style sheet, your site becomes
MUCH EASIER to maintain. You can change the layout of all your pages by editing one file.
Because advanced layouts take time to create, a quicker option is to use a template. Templates are pre-built website
layouts you can use and customize.

HTML Layout Tags

Tag Description
<div> Defines a section in a document
<span> Defines a section in a document
19.3.1 HTML Forms

HTML forms are used to pass data to a server.

A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can
also contain select lists, text area, fieldset, legend, and label elements.

The <form> tag is used to create an HTML form:

< form>
.
input elements
.
< /form>
HTML Forms - The Input Element

The most important form element is the input element.

The input element is used to select user information.

An input element can vary in many ways, depending on the type attribute. An input element can be of type text field,
checkbox, password, radio button, submit button, and more.

The most used input types are described below.

Text Fields

<input type="text" /> defines a one-line input field that a user can enter text into:

< form>
First name:< input type="text" name="firstname" /><br />
Last name:< input type="text" name="lastname" />
< /form>

How the HTML code above looks in a browser:

First name:

Last name:

Note: The form itself is not visible. Also note that the default width of a text field is 20 characters.

Password Field
<input type="password" /> defines a password field:

< form>
Password:< input type="password" name="pwd" />
< /form>

How the HTML code above looks in a browser:

Password:

Note: The characters in a password field are masked (shown as asterisks or circles).

Radio Buttons

<input type="radio" /> defines a radio button. Radio buttons let a user select ONLY ONE of a limited number of
choices:

< form>
< input type="radio" name="sex" value="male" /> Male<br />
< input type="radio" name="sex" value="female" /> Female
< /form>

How the HTML code above looks in a browser:

Male

Female

Checkboxes

<input type="checkbox" /> defines a checkbox. Checkboxes let a user select ONE or MORE options of a limited
number of choices.

< form>
< input type="checkbox" name="vehicle" value="Bike" /> I have a bike<br />
< input type="checkbox" name="vehicle" value="Car" /> I have a car
< /form>

How the HTML code above looks in a browser:

I have a bike

I have a car
Submit Button

<input type="submit" /> defines a submit button.

A submit button is used to send form data to a server. The data is sent to the page specified in the form's action
attribute. The file defined in the action attribute usually does something with the received input:
< form name="input" action="html_form_action.asp" method="get">
Username:< input type="text" name="user" />
< input type="submit" value="Submit" />
< /form>

How the HTML code above looks in a browser:

Submit
Username:

If you type some characters in the text field above, and click the "Submit" button, the browser will send your input
to a page called "html_form_action.asp". The page will show you the received input.

HTML Form Tags

Tag Description
<form> Defines an HTML form for user input
<input /> Defines an input control
<textarea> Defines a multi-line text input control
<label> Defines a label for an input element
<fieldset> Defines a border around elements in a form
<legend> Defines a caption for a fieldset element
<select> Defines a select list (drop-down list)
<optgroup> Defines a group of related options in a select list
<option> Defines an option in a select list
<button> Defines a push button

19.4 HTML Iframes


An iframe is used to display a web page within a web page.

Syntax for adding an iframe:

< iframe src="URL"></iframe>

The URL points to the location of the separate page.

Iframe - Set Height and Width

The height and width attributes are used to specify the height and width of the iframe.

The attribute values are specified in pixels by default, but they can also be in percent (like "80%").

Example

< iframe src="demo_iframe.htm" width="200" height="200"></iframe>


Iframe - Remove the Border

The frameborder attribute specifies whether or not to display a border around the iframe.
Set the attribute value to "0" to remove the border:

Example

< iframe src="demo_iframe.htm" frameborder="0"></iframe>


Use iframe as a Target for a Link

An iframe can be used as the target frame for a link. The target attribute of a link must refer to the name attribute of
the iframe:

Example

<iframe src="demo_iframe.htm" name="iframe_a"></iframe>


<p><a href="http://www.w3schools.com" target="iframe_a">W3Schools.com</a></p>
HTML iframe Tag

Tag Description
<iframe> Defines an inline sub window (frame)

19.5 HTML Colors


Colors are displayed combining RED, GREEN, and BLUE light.

Color Values

HTML colors are defined using a hexadecimal notation (HEX) for the combination of Red, Green, and Blue color
values (RGB).

The lowest value that can be given to one of the light sources is 0 (in HEX: 00). The highest value is 255 (in HEX:
FF).

HEX values are specified as 3 pairs of two-digit numbers, starting with a # sign.

Color Values

Color Color HEX Color RGB

#000000 rgb(0,0,0)

#FF0000 rgb(255,0,0)

#00FF00 rgb(0,255,0)

#0000FF rgb(0,0,255)

#FFFF00 rgb(255,255,0)

#00FFFF rgb(0,255,255)
Color Color HEX Color RGB

#FF00FF rgb(255,0,255)

#C0C0C0 rgb(192,192,192)

#FFFFFF rgb(255,255,255)

You might also like