Sei sulla pagina 1di 5

CAP604T: Web Programming Homework 1

DOA: 30/8/12 Part A Q1. With the help of examples explain the function of LINK, ALINK and VLINK attributes? Ans
LINK= This Attribute will let you define the color that ALL of your Links are displayed as: LINK="#9966ff" VLINK= The VLINK [Visited Link] defines the color that ALL the Visited Links appear in. If you click on a Link and go to a page, and then come back to the original page, the Link you just clicked on is now another color. You can define that color using VLINK: VLINK="#3399ff" ALINK= The ALINK [Active Link] sets the color the Links will turn as you click on them: ALINK="#000000" <html> <head></head> <body TEXT="#FFFFFF" LINK="#9966ff" VLINK= "#3399ff"

DOS: 10/9/2012

ALINK="#000000" BGCOLOR="#000000" >

<a href="http://www.google.com">google it dude</a><br> <a href="http://www.yahoo.com">yahoo00oo!</a><br> <a href="http://www.fb.com">come on face it!</a> </body> </html>

Q2. Create a table in HTML. Demonstrate the use of various attributes such as rowspan, colspan, cellpadding and cellspacing? Ans
At their most basic, tables are made up cells, arranged into rows. You can control display characteristics for the whole table, for individual rows, and for individual cells.

In Figure , <th colspan=5> tells the browser to make "cell 1" occupy the same horizontal space as two cells ("span" over two columns). The resulting spanned cell is indicated in the figure on the left. Note that the row containing the spanned cell now only has one set of <td> tags instead of two. Setting the colspan to a number greater than the actual number of columns (such as colspan=10 for our example) may cause some browsers to add empty columns to the table, possibly throwing your elements out of alignment. Similar to colspan, the rowspan attribute stretches a cell to occupy the space of cells in rows below. Include the rowspan attribute in the row where you want the cell to begin and set its value equal to the number of rows you want it to span. There are two types of space that can be added in and around table cells: cell padding and cell spacing. The cellpadding and cellspacing attributes are used within the <table> tag and apply to the whole table (you can't specify padding or spacing for individual cells). The amount of space between table cells is controlled by the cellspacing attribute within the <table> tag. Values are specified in number of pixels. Increasing the cell spacing results in wider shaded borders between cells. The default value for cellspacing is 2; therefore, if no cellspacing is specified, browsers will automatically place 2 pixels of space between cells. Cell padding refers to the amount of space between the cell's border and the contents of the cell. It is specified using the cellpadding attribute within the <table> tag. Values are specified in number of pixels; the default value is 1. Relative values (percentages of available space) may also be used. For example: <TABLE border="1" cellpadding="5" cellspacing="2" <TR > <TH rowspan="6" >History Courses For Autumn Exams </TH> </TR> <TR > <TH colspan="5" >Community Courses -- Bath Autumn

2012</TH> </TR> <TR> <TH > Course Name</TH> <TH > Course Tutor</TH> <TH > Summary</TH> <TH > Code</TH> <TH> Fee</TH> </TR> <TR> <TD>After the Civil War</TD> <TD>Dr. John Wroughton</TD> <TD> The course will examine the turbulent years in

England after 1646.<i> 6 weekly meetings starting Monday 13th October.</i> </TD> <TD>H27</TD> <TD>&pound;32</TD> </TR> <TR> <TD >An Introduction to Anglo-Saxon England</TD> <TD>Mark Cottle</TD>

<TD> One day course introducing the early medieval period reconstruction the Anglo-Saxons and their society.<i>Saturday 18th October.</i> </TD> <TD>H28</TD> <TD>&pound;18</TD> </TR> <TR> <TD>The Glory that was Greece</TD> <TD>Valerie Lorenz</TD> <TD> Birthplace of democracy, philosophy, heartland of

theater, home of argument. The Romans may have done it but the Greeks

did it first.<i>Saturday day school 25th October 1997</i> </TD> <TD>H30</TD> <TD>&pound;18</TD> </TR> </TABLE>

Q3. Write a code in HTML that creates three images: first on left, second on center and third on right in a web page? Part B Q4. Write a code in HTML to create a feedback form for a website? Ans

Q5. Write a code to resize an image with HTML? Also write a code in HTML that links this image to another web page? Q6. What is the function of image maps? Also explain its attributes and two ways to declare the image maps with example?

Potrebbero piacerti anche