Sunteți pe pagina 1din 8

Homework no.

:2

Fundamental of web programming


CAP (214)
Submitted to: submitted
by: Sakshi sharma

Mandeep kaur mam section:d3802

Roll no:A16

Part A

1. Real-time communication is preferred over asynchronous communication. Why?

ANS. Real-time communication is preferred over asynchronous communication because of


asynchronous communication is the exchange of messages and devices in a computer, by reading and
responding as schedules permit rather than according to some clock that is synchronized for both the
sender and receiver or in real time. It is usually used to describe communications in which data can be
transmitted intermittently rather than in a steady stream.

In asynchronous communications it is necessary for the receiver to be able to distinguish between valid
data and noise. Asynchronous communications also include computer-based exchanges of messages for
which the participants need not be available or online at the same time, but, rather, read and respond as
their schedules (and desires) permit. Examples include e-mail, discussion boards and text messaging
over cell phones.

2. HTML is used to create web pages by a web developer. What is HTML? Explain the typical
structure of an HTML program.
ANS. No, it’s not a correct statement; HTML is not used to create web pages by a web developer.

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

Typical structures of html are:

Every HTML program has one simple structure. There are two major components to the structure of a
web site, the "head" and "body". The "head" provides the title and other information about your web
site , while the "body" provides the information and content. Each of these components are marked by
"tags", which let the computer know where the information is written. There are two types of "tags",
opening tags and closing tags. Opening tags have one triangular bracket (</>) on each of their two
sides, while closing tags start and end with a triangular bracket and a slash (/)at the beginning. Lastly,
all web sites begin with the tag <html> and close with the tag </html>.

Example:

<html>

<head>
<title>|
</title>
</head>

<body>
</body>

</html>

3. How can you resize an image with HTML .

ANS. To do this you need to specify the width and height in your image tag. Here is an example:

<img src="http://www.google.com/title.gif" width="200" height="85">

Example:

Original:

Google.com
Using the above source:

Google.com

Part B

4. Using appropriate example show the working and various attributes of

<marquee> tag.

ANS . Attributes :

Behavior : Specifies how the marquee should scroll. Valid values are: "scroll", "alternate",
or "slide." The default value is "scroll."

Direction: Specifies the direction the marquee should scroll. Valid values are: "left", "right", "up", and
"down." The default value is "right."

Width : Specifies the width of the marquee, in px or % units.

Height : Specifies the height of the marquee, in px or % units.

scrollAmount : Specifies the amount in pixels the marquee should scroll each time it's redrawn (see
scrollDelay). The default value is "6".

scrollDelay : Specifies the amount in milliseconds between times the marquee is redrawn. Default
value is "85".

trueSpeed : Specifies whether the marquee should catch up with any skipped cycles. The default value
is "false."

Loop : Specifies the number of times the marquee should repeat itself when it reaches the end of the
message. The default value is "infinite."
Example : <html>

<head>

<title>working with marquee tag

</title>

<body bgcolor="blue">

FONT SIZE="4" FACE="courier" COLOR=blue><MARQUEE WIDTH=100%


BEHAVIOR=SCROLL DIRECTION=RIGHT BGColor=yellow>This is an example of a marquee
scrolling to the right...</MARQUEE></FONT>

<FONT SIZE="4" FACE="courier" COLOR=blue><MARQUEE WIDTH=100%


BEHAVIOR=SCROLL DIRECTION=RIGHT BGColor=yellow>This is an example of a marquee
scrolling to the right...</MARQUEE></FONT>

<FONT SIZE="4" FACE="courier" COLOR=blue><MARQUEE BEHAVIOR=SCROLL


HEIGHT=25 WIDTH=300 BGColor=yellow>This is an example of a scrolling
marquee</MARQUEE></FONT>

</body>

</html>

5. How can you insert a movie into a HTML document?

ANS . Users can embed a movie into a HTML document using any of the below examples. It is
important to realize that before you use the below examples that you understand what type of movie
you are going to be playing as well as the browsers that are going to be playing the files. By default a
browser may not have the necessary plug-in to view your movie file.

Link to movie files


Basic embed command
Add movie files using the img tag
Embed command to play QuickTime movies ( .mov )

6. Q: Implement Following table:

ANS . <html>
<title>

son of sardar

</title>

<head>

</head>

<body bgcolor=red>

<table border=5>

<tr>

<th> student information </th>

</tr>

<tr>

<th>section</th>

<th>fail</th>

<th> above85% </th>

</tr>

<tr>

<td> d3802</td>

<td> 20 </td>

<td>

<table border=5>

<th>name</th>

<th> age</th>

<th> no </th>

</tr>
<tr>

<td> jaggi </td>

<td> 21 </td>

<td> 90</td>

</tr>

<tr>

<td> vivek</td>

<td> 18</td>

<td> 85</td>

</tr>

<tr>

<td> amar</td>

<td> 20</td>

<td> 70</td>

</table>

<tr>

<td>d3802 </td>

<td> 35</td>

</tr>

</table>

</html>

S-ar putea să vă placă și