Professional Documents
Culture Documents
B. Image Location
• The location address for the image is inserted as a value for the src attribute between a
pair of quotation marks (“”):
<HTML>
<HEAD>
<TITLE>first page</TITLE>
</HEAD>
<BODY>
<IMG SRC="tree.jpg" ALT="" />
</BODY>
</HTML>
C. Image Resizing
• The width and height attributes can be used to define an image’s size; these attributes
can increase or decrease the image’s actual size to a preferred height and/or width.
• The value can be specified in fixed value (pixels) or as a percentage:
<HTML>
<HEAD>
<TITLE>first page</TITLE>
</HEAD>
<BODY>
<IMG SRC="tree.jpg" HEIGHT="150px" WIDTH="150px" ALT="" />
<!-- or -->
<IMG SRC="tree.jpg" HEIGHT="50%" WIDTH="50%" ALT="" />
</BODY>
</HTML>
D. Image Borders
• An image has no borders by default. Use the border attribute within the image tag to create
a border around the image.
<IMG SRC="tree.jpg" HEIGHT="150px" WIDTH="150px" BORDER="1px"
ALT="" />
II. Lists
A. Ordered Lists
• An ordered list starts with the <OL> tag, and each list item is defined by <LI> tag.
• Each item on the list is organized through numbers, in increasing order:
<HTML>
<HEAD>
<TITLE>Lists</TITLE>
</HEAD>
<BODY>
<OL>
<LI>Red</LI>
<LI>Blue</LI>
<LI>Green</LI>
</OL>
</BODY>
</HTML>
B. Unordered Lists
• An unordered list starts with the <UL> tag; each item is also defined by the <LI> tag:
<HTML>
<HEAD>
<TITLE>List</TITLE>
</HEAD>
<BODY>
<UL>
<LI>Red</LI>
<LI>Blue</LI>
<LI>Green</LI>
</UL>
</BODY>
</HTML>
III. Tables
A. Creating a Table
• Tables are defined by using the <TABLE> tag.
• Table rows are defined using the <TR> tag.
• Table columns (or table data) are defined using the <TD> tag:
<TABLE>
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
• Similarly, the <SPAN> element is an inline element that is often used as a container for some
text.
<HTML>
<BODY>
<H2>Some
<SPAN STYLE="color:red">Important</SPAN>
Message</H2>
</BODY>
</HTML>
V. Forms
• Forms, in general, are used to collect information from the user.
• Forms in HTML are defined using the <FORM> element, with its opening and closing tags.
<BODY>
<FORM>…</FORM>
</BODY>
• The ACTION attribute can be used to point to a webpage that will load after the user submits
the form.
<FORM ACTION="http://www.sti.edu">
</FORM>
• The METHOD attribute specifies the HTTP method (GET or POST) to be used when forms
are submitted.
<FORM ACTION="url" METHOD="GET">
A. Form Elements
• To take in user input, you need the corresponding form elements, such as text fields.
• The <INPUT> element has many variations, depending on the value of TYPE attribute.
o The NAME value specifies the name of a form.
o The TEXT value creates a textbox for any alphanumeric input supplied by a user.
o The PASSWORD value creates a textbox, but with input masked by symbols so the
input cannot be seen:
<FORM>
<INPUT TYPE="text" NAME="username"><BR />
<INPUT TYPE="password" NAME="password">
</FORM>
o The RADIO value creates a radio button that can be used for selecting one choice from
a list of possible choices:
<INPUT TYPE="radio" NAME="gender" VALUE="male"> Male <BR
/>
<INPUT TYPE="radio" NAME="gender" VALUE="female"> Female
<BR />
o The CHECKBOX value creates a checkbox that can be used for selecting multiple
choices from a list:
<INPUT TYPE="checkbox" NAME="gender" VALUE="1"> Male <BR
/>
B. Color Values
• All of the possible red, green, and blue combinations potentially number over 16 million.
• This is the reason why the hexadecimal format is used for: accommodating all the
potential color combinations.
VII. Frames
<FRAMESET COLS="25%,50%,25%">
<FRAME SRC="frame_a.htm">
<FRAME SRC="frame_b.htm">
<FRAME SRC="frame_c.htm">
</FRAMESET>
o The <FRAMESET> element specifies the number of columns or rows in the
frameset, as well as what percentage or number of pixels of space each of them
contains.
<FRAMESET COLS="100, 25%, *"></FRAMESET>
<FRAMESET ROWS="100, 25%, *"></FRAMESET>
Reference:
SoloLearn.com – HTML. Retrieved on May 07, 2018 at
https://www.sololearn.com/Play/HTML/