Showing posts with label web design. Show all posts
Showing posts with label web design. Show all posts

Monday, April 6, 2015

HTML FORMS element

•Forms are a vital tool for the webmaster to receive information from the web surfer, such as: their name, email address, credit card, etc. A form will take input from the viewer and depending on your needs, you may store that data into a file, place an order, gather user statistics, register the person to your web forum, or maybe subscribe them to your weekly newsletter.
 Text Fields
•Before we teach you how to make a complete form, let's start out with the basics of forms. Input fields are going to be the KEY THINGS on your form's needs. The <input> has a few attributes that you should be aware of:-
–type - Determines what kind of input field it will be. Possible choices are text, submit, and password.
–name - Assigns a name to the given field so that you may reference it later.
–size - Sets the horizontal width of the field. The unit of measurement is in blank spaces.
–maxlength - Dictates the maximum number of characters that can be entered.
•Example of html code for input forms
<form method="post" action="mailto:youremail@email.com">
Name: <input type="text" size="10" maxlength="40" name="name"> <br /> Password: <input type="password" size="10" maxlength="10" name="password">
</form> 

HTML Form Email
•Now we will add the submit functionality to your form. Generally, the button should be the last item of your form and have its name attribute set to "Send" or "Submit". Name defines what the label of the button will be. Here is a list of important attributes of the submit:
•In addition to adding the submit button, we must also add a destination for this information and specify how we want it to travel to that place. Adding the following attributes to your <form> will do just this.
•method - We will only be using the post functionality of method, which sends the data without displaying any of the information to the visitor.
•action - Specifies the URL to send the data to. We will be sending our information to a fake email address.

HTML Code:
•<form method="post" action="mailto:youremail@email.com">
•Name: <input type="text" size="10" maxlength="40" name="name"> <br />
•Password: <input type="password" size="10"
•maxlength="10" name="password"><br />
<input type="submit" value="Send">
•</form>

•HTML Radio Buttons
–Radio buttons are a popular form of interaction. You may have seen them on quizzes, questionnaires, and other web sites that give the user a multiple choice question. Below are a couple attributes you should know that relate to the radio button.
•value - specifies what will be sent if the user chooses this radio button. Only one value will be sent for a given group of radio buttons (see name for more information).
•name - defines which set of radio buttons that it is a part of. Below we have 2 groups: shade and size.
•Example of HTML code for radio button
<form method="post" action="mailto:youremail@email.com">
 What kind of shirt are you wearing? <br />
Shade:
<input type="radio" name="shade" value="dark">Dark <input type="radio" name="shade" value="light">Light <br />
Size:
<input type="radio" name="size" value="small">Small <input type="radio" name="size" value="medium">Medium <input type="radio" name="size" value="large">Large <br /> <input type="submit" value="Email Myself">
</form>

•Check boxes allow for multiple items to be selected for a certain group of choices. The check box's name and value attributes behave the same as a radio button.
–Example of HTML code for check box
–HTML Code:
–<form method="post" action="mailto:youremail@email.com"> Select your favorite cartoon characters.
  <input type="checkbox" name="toon" value="Goofy">Goofy <input type="checkbox" name="toon" value="Donald">Donald <input type="checkbox" name="toon" value="Bugs">Bugs Bunny <input type="checkbox" name="toon" value="Scoob">Scooby Doo <input type="submit" value="Email Myself">
</form>

HTML Drop Down Lists
•Drop down menues are created with the <select> and <option> tags. <select> is the list itself and each <option> is an available choice for the user.
–Example of HTML code for drop down lists
–<form method="post" action="mailto:youremail@email.com"> College Degree?
–<select name="degree">
–<option>Choose One</option>
–<option>Some High School</option>
–<option>High School Degree</option>
–<option>Some College</option>
–<option>Bachelor's Degree</option>
–<option>Doctorate</option>
–<input type="submit" value="Email Yourself">
–</select>
–</form>


HTML FRAMES

•Frames allow for multiple ".html" documents to be displayed inside of one browser window at a time. This means that one page has no content on it, but rather tells the browser which web pages you would like to open
Frames - A Generic Frame Page
•Frames are most typically used to have a menu in one frame, and content in another frame. When someone clicks a link on the menu that web page is then opened on the content page.
–HTML Code:
–<html>
–<head>
–</head>
–<frameset cols="30%,*">
– <frame src="menu.html">
–<frame src="content.html">
– </frameset>

–</html>

 

HTML TABLES element

  Tables are used on websites for two major purposes:
–The obvious purpose of arranging information in a table

–The less obvious - but more widely used - purpose of creating a page layout with the use of hidden tables.

••The <table> tag is used to begin a table. Within a table element are the <tr> (table rows) and <td> (table columns) tags. Tables are a handy way to create a site's layout, but it does take some getting used to.
HTML Code:
•<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> 

Cell Padding and Spacing
•With the cellpadding and cellspacing attributes you will be able to adjust the white space on your tables. Spacing defines the width of the border, while padding represents the distance between cell borders and the content within. Color has been added to the table to emphasize these attributes.
•HTML Code:
•<table border="1" cellspacing="10"
bgcolor="rgb(0,255,0)">
•<tr>
•<th>Column 1</th>
• <th>Column 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>

 

GRAPHIC ELEMENT

•Images are a staple of any web designer, so it is very important that you understand how to use them properly. Use the <img /> tag to place an image on your web page.
HTML Code:
•<img src="sunset.gif" />
HTML - Image Height and Width
•To define the height and width of the image, rather than letting the browser compute the size, use the height and width attributes.
HTML Code:

•<img src="sunset.gif" height="50" width="100"> 

•But once the image is online, it can also be linked to like this:
  <imgsrc="http://nmc.loyola.edu/intro/images/arrow.gif">
To align image
<img src="images/book.gif" width="253" height="289" align="right">
Background Image
<body background=“tangazo.jpg">

HTML - Formatting Elements

•As you begin to place more and more elements onto your web site, it will become necessary to make minor changes to the formatting of those elements
•Bold, Italic and More
•HTML Code:
•<p>An example of <b>Bold Text</b></p>
•<p>An example of <em>Emphasized Text</em></p> <p>An example of <strong>StrongText</strong></p>
•<p>An example of <i>Italic Text</i></p>
•<p>An example of <sup>superscripted Text</sup></p>
•<p>An example of <sub>subscripted Text</sub></p>
•<p>An example of <del>strikethrough Text</del></p>

• <p>An example of <code>Computer Code Text</code></p>

HTML LISTS element

•Here are 3 different types of lists. A <ol> tag starts an ordered list, <ul> for unordered lists, and <dl> for definition lists. Use the type and start attributes to fine tune your lists accordingly.
–<ul> - unordered list; bullets
–<ol> - ordered list; numbers
–<dl> - definition list; dictionary

•HTML Ordered Lists
–Use the <ol> tag to begin an ordered list. Place the <li> (list item) tag between your opening <ol> and closing </ol> tags to create list items. Ordered simply means numbered .
–HTML Code:
–<h4 align="center">Goals</h4>
–<ol> <li>Find a Job</li>
–<li>Get Money</li>
–<li>Move Out</li>
–</ol>
• •HTML Unordered Lists
•Create a bulleted list with the <ul> tag. The bullet itself comes in three flavors: squares, discs, and circles. The default bullet displayed by most web browsers is the traditional full disc.
•HTML Code:
•<h4 align="center">Shopping List</h4>
•<ul> <li>Milk</li>
•<li>Toilet Paper</li>
•<li>Cereal</li>
•<li>Bread</li>
•</ul> 

•HTML Definition Term Lists
•Make definition lists as seen in dictionaries using the <dl> tag. These lists displace the term word just above the definition itself for a unique look. It's wise to bold the terms to displace them further.
–<dl> - defines the start of the list
–<dt> - definition term
–<dd> - defining definition
•HTML Code:
•<dl> <dt><b>Fromage</b>
•</dt> <dd>French word for cheese.</dd> <dt><b>Voiture</b></dt>
•<dd>French word for car.</dd>
•</dl>
•  

Line Breaks

•A line break ends the line you are currently on and resumes on the next line. Placing <br /> within the code is the same as pressing the return key in a word processor. Use the <br /> tag within the <p> (paragraph) tag.
•HTML Code:
<p> Will Mateson<br />
Box 61<br />
Cleveland, Ohio<br />

 </p>


HTML - Links and Anchors

•The web got its spidery name from the plentiful connections between web sites. These connections are made using anchor tags to create links. Text, Images, and Forms may be used to create these links .
HTML - Hypertext Reference (href)
The href attribute defines reference that the link refers to. Basically this is where the user will be taken if they wish to click this link
Hypertext references can be Internal, Local, or Global.
•Internal - Links to anchors on the current page
•Local - Links to other pages within your domain
•Global - Links to other domains outside of your sit
HTML Code:
•Internal - href="#anchorname"
•Local - href="../pics/sunset.jpg"
•Global - href="http://www.tizag.com/"

HTML - Text Links

•Use the <a></a> tags to define the start and ending of an anchor,Which allows the web to be the outstanding collection of linked information. Decide what type of href attribute you need and place this attribute into the opening tag. The text you place between the opening and closing tags will be shown as the link on a page.The HREF atribute stand for Hypertext Reference --- the technical name for the link.
HTML Code:
•<a href="http://www.tizag.com/" target="_blank" >Tizag Home</a>
•<a href="http://www.espn.com/" target="_blank" >ESPN Home</a>
•<a href="http://www.yahoo.com/" target="_blank" >Yahoo Home</a> 

HTML - Font and Basefont

•The <font> tag is used to add style, size, and color to the text on your site. Use the size, color, and face attributes to customize your fonts. Use a <basefont> tag to set all of your text to the same size, face, and color.
Font Size
•Set the size of your font with size. The range of accepted values is from 1(smallest) to 7(largest).The default size of a font is 3.
HTML Code:
•<p>
•<font size="5">Here is a size 5 font</font>

• </p> 

Font Color
•Set the color of your font with color.
HTML Code:
•<font color="#990000">This text is hexcolor #990000</font> <br />
<font color="red">This text is red</font>

•Font Face
•Choose a different font face using any font you have installed. Be aware that if the user viewing the page doesn't have the font installed, they will not be able to see it. Instead they will default to Times New Roman. An option is to choose a few that are similar in appearance.
•HTML Code:
•<p> <font face="Bookman Old Style, Book Antiqua, Garamond">This paragraph has had its font...</font>
  </p>
 

Paragraph Tag (p)

Publishing any kind of written works requires the use of a paragraph.
•The <p> tag defines a paragraph. Using this tag places a blank line above and below the text of the paragraph. These automated blank lines are examples of how a tag "marks" a paragraph and the web browser automatically understands how to display the paragraph text because of the paragraph tag.
HTML Code:

•<p>Avoid losing floppy disks with important school...</p> <p>For instance, let's say you had a HUGE school...</p> 

HTML - Paragraph Justification

•Paragraphs can be formatted in HTML much the same as you would expect to find in a word processing program. Here the align attribute is used to "justify" our paragraph.
•HTML Code:
•<p align="justify">For instance, let's say you had a HUGE school or work...</p>
HTML - Paragraph Centering
•<p align="center">For instance, let's say you had a HUGE school or work...</p>
HTML - Paragraph Align Right
•<p align="right">For instance, let's say you had a HUGE school or work...</p> 

HTML Color Code - Breaking the Code

•The following table shows how letters are incorporated into the hexadecimal essentially extending the numbers system to 16 values
•Hexadecimal Color Values:

decimal
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
hexadecimal
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F

HTML Coloring System - Hexadecimal

•The hexadecimal system is complex and difficult to understand at first. Rest assured that the system becomes much, MUCH easier with practice and as a blossoming web developer, it is critical to understand hexadecimals to be capable of using them in your own web publications. They are far more reliable and widely compatible among web browsers and are the standard for colors on the internet.
•A hexadecimal is a 6 digit representation of a color. The first two digits(RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB).

•eg. bgcolor="#RRGGBB" 

HTML Color Coding System - Color Names

•Here are 3 different methods to set color. The simplest being the Generic terms of colors. Examples: black, white, red, green, and blue. Generic colors are preset HTML coded colors where the value is simply the name of each color.
HTML Coloring System - RGB Values
•We do not recommend that you use RGB for safe web design because non-IE browsers do not support HTML RGB.
•RGB stands for Red, Green, Blue. Each can have a value from 0 (none of that color) to 255 (fully that color). The format for RGB is - rgb(RED, GREEN, BLUE), just like the name implies
•Red, Green, and Blue Values:
•bgcolor="rgb(255,255,255)"White
•bgcolor="rgb(255,0,0)"Red
•bgcolor="rgb(0,255,0)"Green

•bgcolor="rgb(0,0,255)"Blue

SET BACKGROUND COLOR

•The bgcolor attribute is used to control the background of an HTML element, specifically page and table backgrounds. Bgcolor can be placed within several of the HTML tags
Syntax
<TAGNAME bgcolor="value">
HTML Code:
<body bgcolor="Silver">

<p>We set the background...</p> </body>

REVIEW QUESTIONS

•Elements consist of three parts. Name them.
•There are four main elements to every web page. Write them down.
•Create a primitive Site

The body Element

•The <body> element is where all content is placed. (Paragraphs, pictures, tables, etc). For now, it is only important to understand that the body element will encapsulate all of your webpage's viewable content.
•HTML Code:
•<html>
•<head>
•<title>My WebPage!
•</title>
•</head>
•<body> Hello World! All my content goes here!
•</body>
•</html>

 
biz.