SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 1 of 46 Note: This question-bank contains three sections. Section-A contains 1 mark Multiple Choice Objective type questions. Section-B contains 5 marks subjective questions. Section-A contains 10 marks subjective questions. Section – A [QUESTIONS 1 TO 100] 1 Marks Questions [PAGE 1 TO 9] MULTIPLE CHOICE OBJECTIVE TYPE QUESTION Q1. Internet is a) a local computer network b) a world wide network of computers c) an interconnected network of computers d) a world wide interconnected network of computers which use a common protocol to Communicate with one another Q2. The facilities available in the internet are (i) Electronic mail (ii) remote login (iii) File transfer (iv) word processing A. i, ii C. i, ii, iv B. i, ii, iii D. ii, iii and iv Q3. Internet requires a) an international agreement to connect computers b) a local area network c) a commonly agreed set of rules to communicate between computers d) a World Wide Web Q4. Each computer connected to the internet must a. be an IBM PC b. have a unique IP address c. be internet compatible d. have a modem connection Q5. IP address is currently a. 4 bytes long c. 6 bytes long b. available in plenty d. not assigned as it is all used up Q6. IP addresses are converted to a. a binary string c. a hierarchy of domain names b. alphanumeric string d. a hexadecimal string Q7. Internet addresses must always have at least (i) A country name or organization type (ii) Internet service provider’s name (iii) Name of organization (iv) Name of individual a. i, ii, iii b. ii, iii, iv c. i, iii d. ii, iii, iv, v Q8. Internet uses a. Packet switching b. Circuit switching Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) c. Telephone switching Q9. Internet data is broken up as a. fixed length packets c. not packetized Page 2 of 46 d. Telex switching b. variable length packets d. 64 bytes packets Q10. Internet packet data structure consists of (i) Source address (ii) destination address (iii) Serial number of packets (iv) message bytes (v)Control bits for error checking a) i, ii, b) iii c) i, ii, iii, iv d) i, ii, iii, iv, v Q11. The packets of an internet message a. take a predetermined path b. take a path based on packet priority c. go along different paths based on path availability d. take the shortest path from source to destination Q12. The time taken by internet packets a) can be predetermined before transmission b) may be different for different packets c) is irrelevant for audio packets d) None of these Q13. By an intranet we mean a) a LAN of an organization b) a Wide Area Network connecting all branches of an organization c) a corporate computer network d) a network connecting all computers of an organization and using the internet protocol Q14. By an extranet we mean a) an extra fast computer network b) the intranets of two co-operating organizations interconnected via a secure leased line c) an extra network used by an organization for higher reliability d) an extra connection to internet provided to co-operating organization Q15. World Wide Web a) is another name for internet b) world wide connection for computers c) a collection of linked information residing on computers connected by the internet d) a collection of world wide information Q16. Among services available on the World Wide Web are (i) Encryption (ii) HTTP (iii) HTML (iv) Firewalls a) i and ii b) ii and iii c) iii and iv d) i and iv Q17. A world wide web contains web pages a) residing in many computers b) created using HTML c) with links to other web pages d) residing in many computers linked together using HTML Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Q18. A web page is located using a a. Universal Record Linking c. Universal Record Locator Page 3 of 46 b. Uniform Resource Locator d. Uniformly Reachable Links Q19. A URL specifies the following: (i) protocol used (ii) domain name of server hosting web page (iii) name of folder with required information (iv) name of document formatted using HTML a. i, ii, iii, iv b. ii, iii, iv c. i, iii, iv d. i, ii, iii Q20. A search engine is a program to search a) for information b) web pages c) web pages for specified index terms d) web pages for information using specified search terms Q21. HTML stands for a) Hyper Text Making Links c) Higher Textual Marking of Links b) Hyper Text Markup Language d) Hyper Text Mixer of Links Q22. HTML is similar to a a. word processing language c. scripting language b. screen editor d. search engine Q23. Desirable properties of a website are (i)a meaningful address (ii)Help and search facilities (iii) Links to related sites (iv)Features to allow users to give feedback a. i, ii, iii b. i, ii, iii, iv c. i, ii, iii, iv, d. i, ii Q24. HTML uses a. pre-specified tags c. tags only for linking b. user defined tags d. fixed tags defined by the language Q25. HTML tags define a) The data types of elements of document b) Presentation of specified elements of a document c) The contents of the document d) The structure of the document Q26. The tag used in HTML to link it with other URL’s is: a) <A> b) <H> c) <U> d) <L> Q27. The tags used for specifying fonts in HTML are (i) <B> (ii) <I> (iii) <U> (iv) <L> a) (i) and (ii) b) (i) and (iii) c) (ii) and (iv) d) (i),(ii) and (iii) Q28. It is possible to display pictures (i.e, images) in HTML specification by using the tag. a. <GR src = Picture file> b. <PIC src =Picture file> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) c. <IMG src =Picture file> Page 4 of 46 d. <GIF src=Picture file Q29. SGML stands for a) Standard Generalized Markup Language b) Structured General Markup Language c) Standard Graphics Mapping Language d) Standard General Markup Link Q30. HTML and XML are markup languages a) Specially development for the web b) Are based on SGML c) Are versions of SGML d) Independent of SGML Q31. XML stands for a) Extra Markup Language c) Extended Markup Language b) Excellent Markup Links d) Extended Marking Links Q32. XML uses a) user define tags b) pre-defined tags c) both predefined and user-defined tags d) Extended tags used in HTML and makes them powerful Q33. In order to interpret XML documents one should a) Use standardized tags b) Have a document type definition which defines the tags c) Define the tags separately d) Specify tag filename Q34. The advantages of XML over HTML are (i) It allows processing of data stored in web-pages (ii) It uses meaningful tags which aids in understanding the nature of a document (iii) Is simpler than HTML (iv) It separates presentation and structure of document a. (i), (ii) and (iii) b. (i), (ii) and (iv) c. (ii), (iii) and (iv) d. (i), (iii) and (iv) Q35. The <title> tag belongs where in your HTML ? a. Head b. Arm c. Body d. heading Q36. To add rows to your tables use which tags? a. <td> and </td> b. <cr> and </cr> c. <tr> and </tr> d. <row>and<row> Q37. WYSIWYG stands for ? a. What You See Is What You Get c. What You See Is What You Gain b. When You Start Is When You Go d. What you see is what you give Q38. To start a numbered list with regular numerals use ? a. <ol type="a"> b. <ol type="1"> c. <ol type="I"> d. <ol> type=”one”> Q39. Increasing the cellpadding value will what ? a) Increase the distance between cell and content b) Increase the space between cells Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 5 of 46 c) Increase the softness of your site d) Increase the space between rows Q40. To create a bulleted list use ? a. <il> b. <ul> c. <ol> d. <bl> Q41. Which of these tags are all <table>tags? a. <thead><body><tr> b. <table><tr><td> c. <table><head><tfoot> d. <table><tr><tt> Q42. When images are used as links they get a blue border. a) Always b) Never c) Unless border is set to zero d) None of these Q43. What tag tells where a link starts? a) <l> c) <a> b) <start> d) <link> Q44. To specify a font for your whole page add which tag ? a) <targetfont> b) <defaultfont> c) <basefont> d) <font type=”all”> Q45. Imagelinks can show a text label if you add which property? a) alternative b) str c) alt d) label=”Text which you want to display” Q46 Choose the correct HTML tag for the largest heading a) <heading> b) <h6> c) <head> d) <h1> Q47. You can add names to each frame window using which setting ? a) name b) src c) ur d) path Q48. A file that specifies how the screen is divided into frames is called a __________ a) frameset b) frametable c) tablelink d) table frame Q49. Which of the following will NOT be found in the <head> section ? a) Meta tags b) Title c) Table d) None of these Q50. Which tag is used to insert images into your web page ? a) pic b) scr c) img d) insert img Q51. To start a list at the count of 3, use which? a) <ol start="3"> b) <ol begin="3"> c) <ol list="5"> d)<ul list=”3”> Q52. What does vlink mean? a) visited link c) active link b) very good link d)passive link Q53. Colors in plain HTML can be specified using ? a) Meta tags b) Images Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) c) Hexadecimal Colors Q54. Who is making the Web standards? a) The World Wide Web Consortium c) Microsoft Page 6 of 46 d) none of these b) Mozilla d) Netscape Q55. There are how many "browser safe colors" ? a) 16 Million b) 216 c) 256 d) 100 Q56. What is the correct HTML for adding a background color? a) <body background="yellow"> b) <background>yellow</background> c) <body style="background-color:white"> d) None of these Q57. HTML documents are also called ____________ a) metadata b) url c) web sites d) web pages Q58. What is used to store information usually relevant to browsers and searchengines? a) Tabs b) Cookies c) Metatags d) None of these Q59. Defining clickable sub-areas on an image is called? a) imagelinking b) imagemapping c) multiple linking d) Imageset Q60. A markup language is a set of ___________ a) Markup tags b) Markup sentence c) markup style d) none of these Q61. HTML uses _____________ to describe web pages a) documents b) markup tags c) page d) word Q62. To seperate single list items use ? a) <li> and </li> c) <ul> and </ul> b) <ol> and </ol> d) <I>and</I> Q63. What is the most important tool for adding colors to certain areas of the page rather than the entire background? a) Fonts b) Tables c) Images d) none of these Q64. What tag adds a paragraph break after the text ? a) <PARAGRAPH> b) <P> c) <BR> d) <break> Q65. What tag tells where a link starts ? a) <l> b) <start> c) <a> d) <li> Q66. Gif and jpg are the two main types of what ? a) animated effects b) outlines c) Images d) color effects Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 7 of 46 Q67. To set the font for a single link, where do you add the <font></font> tags ? a) Outside the <a> and </a> b) In the <body> tag c) Inside the <a> and </a> tags d) <em> and </em> Q68. Choose the correct HTML tag to make a text italic a) <italic> b) <i> c) <a> d) <it> Q69. Choose the correct HTML tag to make a text bold a) <bold> b) <b> c) <bo> d) none of these Q70. Choose the correct HTML to left-align the content inside a tablecell a) <td valign="left"> b) <tdleft> c) <td align="left"> d) <td leftalign> Q71. Which section is used for text and tags that are shown directly on your web page ? a) Body b) Metatags c) Head d) None of these Q72. Tags and text that do not show directly on the page are placed where ? a) Body b) Tables c) Head d) img Q73. ______ is not a html tag. a) <b> b) <p> c) <h2> d) <im> Q74. Which tag can set the background color for your page? a) <body> b) <head> c) <font> d) <bg> Q75. The <br>tag adds what to your webpage ? a) Line break b) Little bubbles c) Long breaks d) link break Q76. CSS stands for _____________ a) Common Style Script c) Common Style Sheets b) Cascading Style Sheets; d) None of these Q77. _____ used to modify the value of the HTML element. a) html b) body c) Attribute d) style Q78. ______ is not a protocol a) http b) ftp c) sntp d) tcp/ip Q79. Which format usually works best for photos ? a) JPG b) HTML c) GIF d) None of these Q80. ______ is an empty element without a closing tag a) <br> b) <I> c) <p> d) <body> Q81. W3C means____________ a) World Wide Web Control c) World Widely Web Consortium b) World Wide Wep Consortium d) World Wide Web Consortium Q82. src is a property of ____________ tag a) <img> b) <p> c) <font> d) <a> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 8 of 46 Q83. The _________ element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc. a)<img> b)<body> c)<i> d)<em> Q84. DTD means __________________ a) Document type demand c) Document type definition b) Document term design d) DeskTop difination Q85. What is the correct HTML for creating a hyperlink? a) <a name="http://www.qualitypointtech.com">Qualitypoint Technologies</a> b) <a href="http://www.qualitypointtech.com">Qualitypoint Technologies</a> c) <a>http://www.qualitypointtech.com</a> d) d) <a url="http://www.qualitypointtech.com">Qualitypoint Technologies</a> Q86. Which property will open a page in a new window? a) target="_self" b) target="_blank" c) target="_top" d) none of these Q87. _______ is property of marquee tag a) scroll b) upper c) low d) small Q88. To create a list using lowercase letters use ? a) <ol "a"> b) <ol letter="a"> c) <ol type="a"> d) None of these Q89. ______ is used for linking a) <a> b) <p> c) <b> Q90. Comment in HTML document is given by a) <?---> b) <!-c) <!---> d) </-Q91. What will extension for HTML document? a) .xhtml b) .html c) .htm d) <em> --!> -- > d) both b & c Q92. We have use CSS class into our html .But we have divide our page without break line. Which of following we have to use? a) <div> </div> b) <span></span> c) <p> d) None Q93. Choose correct syntax used for internal CSS a) <style type="text/css"> body {background-color: red} </style> b) .<link rel="stylesheet" type="text/css" href="r4rcss.css"> Here r4rcc.css is in to same directory . c) Both d.) None Q94. What is the correct HTML for creating a website linking? a) <a href=”http:\ \ www.google.com”>google</a> b) <a>http://www.google.com</a> c) <a url="http://www.google.com">google.coms.com</a> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 9 of 46 d) <a name="http://google.com">google.com</a> Q95. Which attribute are used in <marquee> tags? a) align,behaviour, scrolling b) behaviour, height,loop c) head,background,anchor d) none Q96. Which command we use to add an Image? a) <image src="url"> b) <img src="url"> c) <src img="url"> d) <img srcimg="url"> Q97. Who is making the Web standards? a) Mozilla c) The World Wide Web Consortium b) Microsoft d) Netscape Q98. Which of these tags are all <table> tags? a) <table><tr><tt> b) <table><tr><td> c) <thead><body><tr> d) <table><head><tfoot> Q99. Choose the correct HTML to left-align the content inside a tablecell a) <td leftalign> b) <td align="left"> c) <td valign="left"> d) <tdleft> 100. What is the correct HTML for making a text input field? a) <input type="text" /> b) <textfield> c) <input type="textfield" /> d) <textinput type="text" /> Answer 1) d 2) b 13) d 14) b 25) b 26) a 37) a 38) b 49) c 50) c 61) b 62) a 73) d 74) a 85) b 86) b 3) c 15) c 27) a 39) a 51) a 63) b 75) a 87) a 4) b 5) a 16) b 17) d 28) c 29) a 40) b 41) b 52) a 53) c 64) b 65) c 76) b 77) c 88) c 89) a 97) c 6) c 18) b 30) b 42) c 54) a 66) c 78) a 90) c 7) c 8) a 9) b 10) c 11) c 12) c 19) a 20) d 21) b 22) a 23) b 24) d 31) c 32) a 33) b 34) b 35) a 36) c 43) c 44) c 45) c 46) d 47) a 48) a 55) c 56) d 57) d 58) c 59) b 60) a 67) c 68) b 69) b 70) c 71) b 72) c 79) a 80) a 81) d 82) a 83) b 84) c 91) d 92) a 93) a 94) a 95) b 96) b 98) b 99) b 100) a Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Section – B [QUESTIONS 1 TO 25] Page 10 of 46 5 Marks Questions [PAGE 10 TO 23] Q1. What do you meant by client/server architecture explain? Ans. Client/Server: - Client/server describes the relationship between two computers in which one is client and another one is server. Client sends request to server and access data is stored on multiple servers. Server fulfills the request of client. Computer transactions using the client/server model are very common. For example, to check your bank account from your computer, a client forwards request to a server at the bank. Client that sends a request to a database server to retrieve your account balance. The balance information is returned back to the client-using server, server fulfills the request of client. Server response to the client according to client request and display the information on client computer. Client side: - The client is a process that sends messages to a server process requesting that the server performs a task. It executes only for the one section. It runs locally on user personal computer. It does not require special software. Server side: - A server process fulfils the client’s request by performing the requested task. Server program generally receives request from client programs, execute database and send response to client’s request. The server-based process may run on another machine. Q2. What is networking? Write the applications of Internet. Ans. Networking: - When two or more computers are connected to each other to share some resources such as files. Folders, disk space, printers, etc and data is called networking. Computers are connected to each other through some medium like copper wires, fiber optics, twisted pair etc. The main purpose of computer network is resource sharing and sharing of information. Internet Applications: - A worldwide network of computer networks. It is an interconnection of large and small networks around the globe. It is the network of networks. It shares common set of communication protocols for communication between two computers on network. Electronic Mail (E-Mail): - Email stands for Electronic mail. E-Mail is the facility of sending textbased messages and letters to any Internet user. Send mail to your friend who is also on the Internet. Everybody on the Internet has his/her own unique e-mail address. Voice E-mail: - In usual e-mail, we type the message in the body of the e-mail in text mode. Recently some companies have introduced software systems, which support voice e-mail. In voice mail, we record our message by speaking and send to the destination address. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 11 of 46 Search Engines: - A program that searches documents for specified keywords. And it returns a list of the documents where the keywords were found. Search engine is really a general class of program .The term is often used to specifically describe systems that enable users to search for documents on the WWW and USENET. E.g. Google, Lycos, khoj, Monkey, AltaVista etc Q3. Why some HTML editors are called WYSIWYG editors? What does this means and why it is never completely true? Ans. HTML editors assist web page designers in the preparation of HTML code. There are two primary types of editors -- text editors and WYSIWYG (what you see is what you get). What-YouSee-Is-What-You-Get. Web-editing programs are programs that are used to create Web sites. WYSIWYG (What You See Is What You Get) Web-authorizing tools. These tools provide an environment similar to a word processor for Web page Development and entire Web sites. Again, there are many products you could choose from in this category. Some of the most popular are Macromedia Dreamweaver, Adobe GoLive, NetObjects Fusion, and Microsoft FrontPage. The major browses also come with free Web authoring tools. Netscape Composer is part of Netscape Communicator, and Microsoft FrontPage Express (a scaled back version of FrontPage) can be bundled with Microsoft Internet Explorer. Web-authoring tools offer you an authoring environment tailored specifically to create Web pages. The Web, however, poses different problems. For example, a Web page might appear different depending on which browser the audience is using, whether they're on Windows or Macintosh, etc. Q4. Write the basic structure of HTML. Ans. Structure of HTML document consists of four parts: 1. Html 2. Head 3. Title 4. Body <html> <head> <title> ---------</title> </head> <body. ------------</body> </html> Html Element: Each html document is presented within two tags <html> and </html> tags. The main purpose of html tag is that it declares that the document is an html web page and be seen in any web browser. Head element or head section: The document between these tags shows some information about the html document such as document title. The most important is the <title> tag, which is placed between <head> and </head> tags. The title of the document is placed between <title> and </title> tags, which is displayed by browser at the top of the browser window. Syntax: <head> <title> --------Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 12 of 46 </title> </head> Body element or body section: The main document of the web page lies between the <body> and </body> tags. Any document written between these tags is called body section. Page background color, text color can be specified as attributes of body tag. Syntax: <body> ----------</body> Q5. Explain the attributes of body tag with example. Ans. The largest part of your HTML document is the body, which contains the content of your document (displayed within the text area of your browser window). All HTML tags of the body of your HTML document must be placed between the open <BODY> tag and the closed </BODY> tag. The body tag has attributes, which you can use to set the colors of your background, text and links and also to include your own background image. They are as follows: BGCOLOR=”white” Sets the background color (other color names: red, black, blue etc) TEXT=”black” Sets the body text color. LINK=”blue” Sets the unvisited hypertext links. VLINK =”purple” Sets the visited hypertext links. ALINK=”red” Sets the active hypertext links (the color of the hypertext link when you have your mouse button depressed). BACKGROUND Set an image as the background. Body attributes are used as part of the open <body> tag. For example: <BODY TEXT="black" LINK="blue" VLINK="purple" ALINK="red" BACKGROUND=”c:\clouds.jpg”> Q6. Explain the prologue and its use in HTML document. Ans. The prologue appears at the beginning of every HTML page, identifies what follows as an HTML document allowing browsers and other special software to distinguish HTML documents from other types (DTDs) of SGML. All HTML documents written according to the current HTML specification (Version 4.01) should use the prologue tag displayed below. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > HTML - The SGML document type being declared: <HTML> ... </HTML> PUBLIC - Identifies the information in quotes as a Formal PUBLIC Identifier. "-" - The minus sign designates unregistered organization. ISO, registered (+) or unregistered () are possible here. W3C is not currently registered with ISO, therefore the (-) is used. W3C - identifies the party responsible for creation/maintenance of the DTD. If the DTD comes from IETF, W3C, etc. you'll see their ID here. DTD - describes the type of objects, called a Public Text Class. In this case, it is a DTD. HTML 4.01 Transitional - is the Public Text Description. Here you'll find the DTD's name plus flavors such as version numbers, "strict", "draft," "transitional," etc. EN - identifies the Public Text Language, describing the natural language in which the public text is written, represented by two, uppercase-only characters from ISO 639. "EN"= English. Q7. How <p> tag is different from <br> tag? Ans. <p> 1. The <p> tag is used to place paragraph <br> 1. The <br> tag is used to insert a single line Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 13 of 46 in your pages. 2. It is a pair tag means need to close. 3. This tag is used to define and format paragraph. When paragraph ends it lives one blank line. 4. Syntax:- <p>----</p> 5.Example:<html> <head> <title>calc</title> </head> <body> <p align=”center”> This paragraph is aligned using the paragraph tag. This paragraph is center aligned. Anything you write in paragraph tag with align attribute set to center get center aligned. </p> </body> </html> break. 2. It is a singular tag means no need to close. 3. The <br>tag is used to provide extra space between lines. 4. Syntax:-<br> 5.Example:<html> <head> <title>calc</title> </head> <body> This is the first line to appear on the page.<br> This is the second line to appear on the page. <br> This is the Third line to appear on the page. </body> </html> Q8. Give an example of ordered list. Or How will you create an ordered list? How the numbering of items can be altered? Explain with the help of an example. Ans. List items that has a specific numerical order or ranking is called ordered list. Sometimes ordered list is called numbered list. Ordered lists can be nested. An ordered list must begin with the <OL> element, which is immediately followed by a <LI> (list item) element. It takes three attributes: 1. Type. 2. Start. 3. Value. Type attribute can take five values 1, a, A, i, I. <HTML> <HEAD> <TITLE>Courses</TITLE> </HEAD> <BODY> <H2>Courses information</H2> <OL type=A> <LI>PGDCA</LI> <LI>MSc</LI> <LI>MCA</LI> <LI>MBA</LI> </OL> </BODY> </HTML> Numbering of an ordered list can be altered by using start attribute. We can start the numbering from anywhere. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 14 of 46 Q9. Explain the use of cell spacing and cell padding? Ans. Cellspacing and Cellpadding attributes are used in the table tag. Cellspacing: - This attribute sets the width in pixels between the individual table cells. Cellspacing attribute sets the amount of space between the cells. Most browsers normally put two pixels of space between cells. If you leave out the cellspacing attribute, you will get a thin gap between cells. Cellpadding: - It is a value, supplied as number of pixels, denotes the amount of space between the edge of the table and its contents. CELLPADDING sets the amount of space (both horizontal and vertical) between the cell wall and the contents. The default value for CELLPADDING (i.e., if you don't use the attribute at all) is 1 Example: <HTML> <HEAD> <TITLE>Student information</TITLE> </HEAD> <BODY> <table border=3 width=30% height=30% cellpadding=50 cellspacing=10> <tr> <th>Name</td> <th>class</td> </tr> <tr> <td>Harman</td> <td>Bsc(IT)</td> </tr> <tr> <td>Harinder</td> <td>DCA</td> </tr> </BODY> </HTML> Output: Name Class Harman Bsc(IT) Harinder DCA Q10. Write down the CSS in detail. Ans. CSS stands for Cascading style sheets. Style sheets are powerful mechanism for adding styles to web documents. They enforce standards and uniformity throughout a web site and provide numerous attributes to create dynamic effects. With style sheets, text and image formatting properties can be predefined in a single list. HTML elements on a web page can be bound to the style sheet. The advantage of a style sheet includes the ability to make global changes to all documents from a single location. Style sheets are said to cascade when they combine to specify the appearance of a page. The style sheet process is accomplished by <STYLE> …… </STYLE> tags. The Style tags are written between <head> …..</head> tags. Style sheets give you greater control over the presentation of your web documents. Using style sheets, you can specify many stylistic attributes of your web page, such as text color, margins, Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 15 of 46 and alignment of elements, font styles, font sizes, font weights and more. You can use borders to make certain elements stand out from the body of the content. In addition, you can use a style sheet as a template or "master page" so that multiple pages can use the same style sheet. Syntax . <style type=”text/css”> tag { attribute :values; attribute: value……..} </style> Using inline styles is not as powerful as an external style sheet. Q11. What are multiple style sheets? Ans. Multiple Style Sheets: - It is possible to define several styles for a tag. E.g. consider the <h1> tag and the following statement. H1 {font: bold 24pt Arial} Suppose that we want three types of <h1> styles with the names chapter, section and subsection. Type of <h1> font style size Chapter Arial bold 24 Section times new roman bold 20 Subsection times new roman italics 18 The style sheet entries will be as follows: H1.a {font: bold 24pt ”Arial”} H1.b {font: bold 20pt ”times new roman “} H1.c {font: italic 18pt ”modern“} We use this tag as: <h1 class=”a”>cal c</h1><br> <h1 class=”b”>cal c</h1><br> <h1 class=”c”>cal c</h1><br> This style can also be applied in between <style> and </style> tags in header section. Q12. Differentiate between <div> and <span> tag. Ans. <div>.A web page can be divided into segments of divisions called DIV’s. Each segment start with <div> and ends with </div>. These segments can be positioned anywhere on the page. The <div> tag has a ‘position’ attribute that can take one of the two values Absolute or Relative. Absolute positions the segment with respect to the top/left edge of the browser window. In contrast with Absolute, Relative positions the segment in relations to other elements on the page. E.g.. <html> <body> <div id=box1 style=”background-color:red; position:absolute; left:300; top:150;width=50”> <img src=” c:\windows\clouds.bmp” width=100 height=100> </div> <div id=box2 style=”background-color:green; position:absolute; left:380; top:150; width=50”> <img src=”c:\windows\juggler.bmp” width=100 height=100 > </div> </body> </html> <span>:- Span is an HTML element that plays a prominent role in style sheets. In the body of the document, <span>…..</span> is used to set the boundaries of the rule’s styling specifications. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 16 of 46 E.g. <html> <head> <style type=”text/css”> .P{font-size:12pt;font-weight:bold;text-align:justify} .question{color:brown;font-style:italic} .big{font-size:16pt;color:red} </style> </head> <body> <p class=”question”> How to create <span class=”big”> style sheet</span>? </p> </body> Q13. Write an HTML code to display the following in the browser Ans:- Sno. Subject Name Max Marks Pass marks 1 2 Subject 1 Subject 2 100 100 35 35 Marks Theory Practical 70 25 60 20 <html> <body> <table border=5 cellpadding=2 cellspacing=2> <tr> <th rowspan=2>sno <th rowspan=2>subject name <th rowspan=2>max marks <th rowspan=2>pass marks <th colspan=2>marks </tr> <tr> <th>theory <th>practical </tr> <tr> <td>1</td> <td>subject 1</td> <td>100</td> <td>35</td> <td>70</td> <td>25</td> </tr> <tr> <td>2</td> <td>subject 2</td> <td>100</td> <td>35</td> <td>60</td> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 17 of 46 <td>20</td> </tr> </table> </body> </html> Q14. Write a note on frames with example. Ans. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles is called a "frame". Frames can divide the screen into separate windows. Frame 1 Frame 2 Each of these windows can contain an HTML document. HTML frames allow authors to present documents in multiple views, which may be independent windows or subwindows. Several Web pages can be displayed in the same browser window. It does not have a closing tag. <frame src=”url”> src attribute accepts the url of the frame content. The src attribute is used to specify the file name, which has to be displayed in each of the frame creates. <html> <frameset cols="30%,50%,*"> <frame src=”filename1”> <framesrc=”filename2”> <frameset rows="50%,50%"> <frame src=”filename3”> <frame src=”filaname4”> </frameset> </frameset> </html> Other attributes of <frame> tag are name, margin height, margin width, scrolling and noresize. Q15. What are nested frames? Give example. Ans. HTML frames allow authors to present documents in multiple views, which may be independent windows or sub-windows. Multiple views offer designers a way to keep certain information visible, while other views are scrolled or replaced. For example, within the same window, one frame might display a static banner; a second a navigation menu, and a third the main document that can be scrolled through or replaced by navigating in the second frame. When we divide a frame further into frames is called nesting of frames. This can be done by placing <frameset>…</frameset> in the other <frameset>…</frameset> tag. Example. <html> <frameset cols=”30%,30%”,*”> Output: <frame> <frameset rows=”50%,50%”> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 18 of 46 <frame> <frame> </frameset> <frame> </frameset> </html> In the above example the whole browser area is divided into three columns and the second column is further divided into two rows. Q16. What are the effects of frame on the performance of Internet usage? Ans. Frame is used to display multiple web pages (documents) on screen at a time. Set the limits of a single frame, or area, within the frameset. A separate document linked with the src attribute appears inside frame. Frames can divide the screen into separate windows. Frame 1 Frame 2 Each of these windows can contain an HTML document. HTML frames allow authors to present documents in multiple views, which may be independent windows or subwindows. Several Web pages can be displayed in the same browser window. It does not have a closing tag. src attribute accepts the url of the frame content. Syntax: <frameset cols=” “ rows=” “> <frame src=”url”> -----------------------------------------</frameset> There are only three frames: <frameset cols="25%,25%,*”> <frame src="frame_a.htm" /> <frame src="frame_b.htm" /> <frame src="frame_c.htm" /> </frameset> Q17. Define Frame Border and Frame Spacing Attributes of Frameset Tag ? Ans. These attributes appear within the frameset tag. frameborder="#" - A zero value shows no "window" border. border="#"- Modifies the border width, used by Netscape navigator. framespacing="#" -Modifies the border width, used by Internet Explorer. Here's an example of the same frameset without the borders. HTML Code: <html> <head> </head> <frameset border="0" frameborder="0" framespacing="0" rows="20%,*"> <frame src="title.html"> <frameset border="0" frameborder="0" framespacing="0" cols="30%,*"> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 19 of 46 <frame src="menu.html"> <frame src="content.html"> </frameset> </frameset> </html> Q18. Differentiate between radio button and check box with example? Ans. Radio buttons Checkboxes User can select only one option using Using check box user can select more than one radio button from the given options. It is option from the given. E.g. one has to choose used where only one choice has to be the hobbies from the given list and one can selected. E.g. Choice of gender have more than one hobby. E.g. (swimming, (MALE/FEMALE). listening music, jogging, Horse riding etc.) All attribute share the same name. Names of all attributes have different name. Syntax: - <Input type=”radio”> Syntax: - <Input type=”checkbox”> Example: Example: <html> <html> <head> <head> <title>RadioButton</title> <title>checkboxes</title> </head> </head> <body> <body> <form method=post> <form method=post> <h1>Nationality</h1> <h1>Hobbies</h1> <input type=”radio” name=”r”> <input type=”checkbox” name=”S”> Horse Indian<br> Riding <br> <input type=”radio” name=”r”>Non- <inputtype=”checkbox” name=”P”>Painting Indian <br> <br><input type=”checkbox” name=”D”> <input type=”submit” value=”Submit”> Dancing <br> </form> <input type=”submit” value=”Submit”> </body> </form> </html> </body> </html> Q19. Write an example to show the working of <Input> tag. Ans. <html> <head> <title>form</title> </head> <body> <form method=post> <b>Firstname</b><input type=text name=”name”><br> <b>Lastname</b><input type=text name=”name1”><br> <b>Password</b><input type=text ><br> Address: Street<input type=text name=”street”><br> Hno<input type=text name=”hno”><br> Colony<input type=text name=”colony”><br> City<input type=text name=”city”><br> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 20 of 46 <input type=submit value=send><br> <input type=reset value=fill again><br> </form> </body> </html> Q20. Explain text area with example. Ans. Text area: - The text area is a multi-line area in which the user can type the text. E.g. a text area can be used to obtain the experience of a user with a company, the suggestion of a user on a new product, etc. Using the <textarea> tag can create a text area. The <textarea> tag has three attributes. They are the: 1. Number of rows 2. Number of columns 3. Name Syntax: <textarea name=” ” rows=” ” cols=” ”> …………… …………… </text> Example: <html> <head> <title>textarea</title> </head> <body> <textarea cols=30 rows=20> Enter more information </textarea> </body> </html> Output: - Q21. Create a program using checkboxes. Ans. <html> <head> <title>checkboxes</title> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 21 of 46 </head> <body> <form method=post> <h1>Hobbies</h1> <input type=checkbox name=S>Horse Riding<br> <input type=checkbox name=P>Painting<br> <input type=checkbox name=D>Dancing<br><br> <input type=submit value=Submit> </form> </body> </html> Output: - Q22. Create a form inside the table? Ans. <html> <head> <title>checkboxes</title> </head> <body> <table border=5> <tr> <th>Username</th> <th><input type=text></th> </tr> <tr> <th>Password</th> <th><input type=password></th> </tr> <tr> <th colspan=2><textarea rows=5 cols=5> Enter information </textarea> </th> </tr> </table> </body> </html> Q23. What is the difference between textbox and text area? Ans. Textbox Text Area Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 22 of 46 Text box is used for single line of text. User can’t enter multiple lines in textbox. It does not have a closing tag. We need not to define its width and height. Attribute of textbox: 1. Type 2. Name Text area is used for multiple lines of text. Multiple lines can be entered in text area. It requires a closing tag. We have to define its width and height. Attribute of text area: 1. Cols 2. Rows 3. Name Example: <textarea name=comment rows=4 cols=9> Enter more information </textarea> Example: <input type=text name=t1> Q24. Create a web page using nesting of lists. Ans. We can use one type of list within other type of list. This is called nesting of lists. Example of nested list: <HTML> <HEAD> <TITLE>Example4</TITLE> </HEAD> <BODY> <H2>COURSES</H2> <ol> <li>PGDCA</li> <ul> <li> C</li> <li>C++</li> </ul> <li>BSC</li> <ul type=square> <li>Fundamentals</li> <li>C</li> <li>C++</li> </ul> </ol> </BODY> </HTML> Q25.Give two differences between cellpadding and cellspacing and rowspan and colspan. Ans:- Difference between cellpadding and cellspacing Cellpadding Cellspacing Cellpadding is used to define the distance of cell spacing is used to set space the text inside the cell from the edges of the between cells. cell of a table. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) <TABLE CELLPADDING="X"> The X in the line, is replaced with the number of pixels you want between the text and cell edge. Page 23 of 46 <TABLE CELLSPACING="X"> The X in the line is replaced with the number of pixels you want between the cells. Difference between rowspan and colspan Rowspan It is used to merge rows of the table in multiple rows It will span the rows vertically. E.g. <td rowspan="3">Row 1-3 </td> Colspan It is used to merge columns of the table in multiple columns It spans the columns horizontally. E.g. <td colspan="5">Cell 1-5 </td> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Section – C [QUESTIONS 1 TO 25] Page 24 of 46 10 Marks Questions [PAGE 24 TO 46] Q1. Explain different type of network topologies. Ans. Topologies: The term topology refers to the way in which the computers of a network are linked together. Topologies define the arrangement of computers in the network. These should be properly planned and implemented because a good selection of topology can result in proper way. Types of Topologies The following sections discuss the physical topologies used in networks and other related topics. Linear Bus Star Ring Tree Linear Bus: -A linear bus topology looks likes a bus that’s why it is called linear bus. Each computer is connected with main cable.(See fig. 1). All computers (file server, workstations, and peripherals) are connected to the linear cable. Ethernet and Local Talk networks use a linear bus topology. Fig. 1. Linear Bus topology Advantages of a Linear Bus Topology Easy to connect a computer or peripheral to a linear bus. Requires less cable length than a star topology. Disadvantages of a Linear Bus Topology Entire network shuts down if there is a break in the main cable. Terminators are required at both ends of the backbone cable. Difficult to identify the problem if the entire network shuts down. Not meant to be used as a stand-alone solution in a large building. Star: - A star topology is designed with each node (file server, workstations, and peripherals) connected directly to a central network hub or concentrator. Data on a star network passes through the hub or concentrator before continuing to its destination. The hub or concentrator manages and controls all functions of the network. It also acts as a repeater for the data flow. This configuration is common with twisted pair cable. However, it can also be used with coaxial cable or fiber optic cable. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 25 of 46 Fig. 2. Star topology Advantages of a Star Topology Easy to install and connect through wire. No difficulty comes to the network while connecting or removing devices. Easy to detect faults and to remove parts. Disadvantages of a Star Topology Requires more cable length than a linear topology. If the hub or concentrator fails, nodes attached are disabled. More expensive than linear bus topologies because of the cost of the Concentrators. Ring: - The ring topology is a type of computer network configuration where each network computer and devices are connected to each other forming a large circle. Each packet is sent around the ring until it reaches its final destination. Today the ring topology is seldom used. Fig. 3. Ring topology Advantages: Ring topology introduces less signal loss as data travelling along the path. Ring-topology network is often used to cover a larger geographic location where implementation of star topology is difficult. Disadvantages: The problem with ring topology is that a break anywhere in the ring will cause network communication to stop. Another drawback of ring topology is that users may access the data circulating around the ring when it passes through his or her computer. Tree : - A tree topology combines characteristics of linear bus and star topologies. It consists of groups of star-configured workstations connected to a linear bus backbone cable (See fig. 4). Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 26 of 46 Tree topologies allow the expansion of an existing network and enable schools to configure a network to meet their needs. Fig. 4. Tree topology Advantages of a Tree Topology: Point-to-point wiring for individual segments. Supported by several hardware and software venders. Disadvantages of a Tree Topology: This type of cabling used limits length of each segment. If the backbone line breaks, the entire segment goes down. More difficult to configure and wire than other topologies. Q2. Discuss the following briefly: a) E-Mail b) WWW c) HTTP d) FTP e) TCP/IP Ans. Email:- Email stands for Electronic mail. It is a system on the internet to send the digital message from a user (called sender) to another user (called recipient). Email system includes application software that are specifically used to send emails only; examples are Microsoft Outlook, Outlook Express, Netscape communicator, etc. In this system Emails can also be sent through some commercial websites such as used to send EMail from one person to another. It is text-based message and letter to be sent to another person. You can send mail to your friend who is also on the Internet. Everybody on the Internet has his/her own unique e-mail address. E-mail allows communication between various computers on the Internet. It is one of the most widely used Internet resources. WWW: - WWW stands for World Wide Web. The World Wide Web is the most popular method of accessing the Internet. It is a collection of pages maintained on the Internet using a technique that is called hypertext. It provides the worldwide information on the Internet. It uses special software called a browser and TCP/IP, http and a web server to function. FTP: - The File Transfer Protocol (FTP) allows an Internet user to move a file from one computer to another on the Internet FTP is an acronym for File Transfer Protocol. As the name implies, FTP is used to transfer files between computers on a network, such as the Internet. You can use FTP to exchange files between computer accounts, to transfer files between an account and a desktop computer, or to access software archives on the Internet. TCP/IP: - TCP stands for Transmission Control Protocol and IP stands for Internet Protocol. Protocol means set of rules and regulation. The Internet Protocol Suite is the set of communications protocols used for the Internet. TCP/IP is the combination of two protocols: Transmission Control Protocol (TCP) and the Internet Protocol (IP) .TCP/IP is the protocol used to send data all around the Internet. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Q3. Differentiate between Internet and Intranet. Ans. Sno. Internet 1. The Internet is created of many interconnected computer networks. 2. This is the worldwide network of computers. 3. No-body owns the internet. 4. 5. 6. 7. 8. Servers provide various services. First of all the concept of internet came in the mind of American’s defense department, named “Advanced research project agency ’’ ,in year 1960. All Computers connected to Internet can access services of the Internet. Any one can connect to the Internet through ISP. Individual who has Internet access can communicate directly with anyone else on the Internet. 9. The Internet has made communication effective and cheap all over the world. 10. The internet uses the Internet Protocol Suite (TCP/IP), HTTP (web services), SMTP (e-mail), and FTP (file transfer protocol) and client– server computing. WWW, e-mail, Instant messaging, file transfer, gopher etc. are few services provided on the internet. 11. Page 27 of 46 Intranet The Intranet is created of all the computers of an organization. This is a network that is not available to the world outside of the Intranet. An organization that has many computers usually owns and operates an Intranet. To provide few services as compare to Internet. The first intranet websites and home pages began to appear in organizations in 1996-97. Unlike public access networks, intranets are restricted to provide security. Only authorized computers of the organization can connect to the intranet. The organization restricts communication between the intranet and the global Internet. The restrictions allow computers inside the organization to exchange information but keep the information confidential and protected from outsiders. It is a powerful tool for communication with in the organizations. It increases employees' ability to perform their jobs faster and more accurately. An intranet is built from the same concepts and technology used for the Internet. E-mail, Instant messaging etc. are few services provided on the intranet. Q4. Define following. a) TELNET b) WebPages c) Gopher d) URL e) WAIS Ans. TELNET: - The telnet program runs on your computer and connects your pc to a server on the network. You can then enter commands through the telnet program and they will be executed as if you were entering them directly on the server console. This enables you to control see server and communicate with other server on the network. To start a telnet session, you must log into a server by entering a valid username and password. Telnet is a common way to remotely control web servers. Web Page: - A document or file, which is created and accessed by web browsers are known as web pages. It includes text, graphics, sound, animation and video etc. Web pages have links known as hyperlinks or hypertexts. On clicking that hypertext another page is opened. A web site Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 28 of 46 is a group of related web pages. Web pages can be built in scripting languages like HTML, XML, DHTML and JavaScript etc. They are used to provide information like organization information, personal information. Gopher: - Gopher was invented at the University of Minnesota in 1993. Gopher was a widely successful method of making menus of material available over the Internet. It was designed to be much easier to use than FTP. It takes a request for information and then scans the Internet for it. The protocol and software follows a client server model and permits users to browse, search and retrieve documents residing on multiple distributed server machines. There are still thousands of Gopher Servers on the Internet. WAIS: - stands for Wide Area Information Servers. Wais is a client server text searching system. A commercial software package that allows the indexing of huge quantities of information and then making those indices searchable across networks such as the Internet. WAIS clients were developed for various operating systems including Windows, Macintosh, NeXT and UNIX. TMC, however, released a free open source version of WAIS to run on Unix in 1991. Q5. How can you send and receive E-mail on Internet? Ans. Email stands for Electronic mail. To send or receive E-mail first condition is that you must have an E-mail id. Email is a computer mail system to send mail from one person to another. Local can be within city, country or international. This is possible via Internet. Visiting any of the following web sites can create a valid E-mail id. These sites provide E-mail id at free of cost. www.yahoomail.com www.rediffmail.com www.lycosmail.com www.mail.com www.punjabtechnicaluniversity.com www.operamail.com After creating E-mail id on any of the above provides web sites. Now you can login with the Email id and the password filled in the form by you while creating Mail-id. After successful login follow the following steps: To Send E-Mail: (a) Click on the link or button having caption compose (yahoo) or write. (b) Type the E-mail id of the person to whom you have to send the mail in the “TO” field. (c) Type the subject in the box provided for subject. (d) Type the message in the space provided for writing your message. (e) After typing your message click on the send button to send Mail. To Receive E-mail: (a) Click on inbox or check mail button. (b) Now you are inside your inbox. (c) Choose the Mail you want to read click on the subject link of that Mail. (d) Read the mail. After sending or reading the mail you must logout (sign out) your Mail Account by clicking the link provided for the same. Ques6. What are various tags present to format text in HTML? OR How text can be formatted in HTML document? Ans. Various formatting tags available in HTML are. S.no Opening Tag Closing Tag Attribute 1 <BODY> </BODY> BGCOLOR="#color Description Background Color Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) code" BACKGROUND="... .gif " TEXT="#color code" 2 3 <CENTER> <H1> to <H6> </CENTER> </H1>to</H6> ALIGN=Left, Center, Right 4 5 <BASEFONT SIZE="1 to7"> <P> </P> <BR> <HR> ALIGN=Left, Center, Right SIZE = number COLOR=red WIDTH = number % NOSHADE 8 <FONT> </FONT> COLOR="#color code" FACE=” Arial” SIZE=number 9 10 11 12 13 14 <B> <I> <STRIKE> <BLOCKQUOT E> <SUB> <SUP> Background Image Text Color Centers Text and Images Heading Align Text Document Font Size ALIGN=Left, Center, Right 6 7 Page 29 of 46 </B> </I> </STRIKE> </BLOCKQUO TE> </SUB> </SUP> New Paragraph Align Text Line Break Horizontal Rule Align Text Thickness of Horizontal Rule Horizontal Rule color % of Document to Span Removes Shading Section of Text Font Color Font Style Font Size Bold Text Italic Text Strike out Text Separates Text Subscript Text Superscript Text Q7. Explain links. Create a link to each of the following: 1. Index.html located in the directory other than parent directory. 2. Link to president’s E-mail address. Ans. Html is used to create links with in html document. The linking of a document within or the other document is through a special connection called hyperlink. The text used to create such link is called “hypertext or hotspot”. The text used for hyperlink is different from normal text. Every hypertext is in blue color. The hypertext link or image is underlined. When the mouse cursor is placed over it, the standard arrow shape of mouse cursor changes to the shape of a hand. The anchor <a> or <A> tag is used for links. Anything written between these tags becomes the hypertext or hotspot. The <a> tag requires href attribute which specifies the target URL. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 30 of 46 <a href=”filename”>hypertext</a> There are three types of links: 1. External links. 2. Internal links. 3. Section links. Example: <html> <head> <title>Link Page</title> </head> <body> Following is the link to index.html<br> <a href=”d:\my web\index.html”>Click to go to Index page</a><br> Following is the link to presidents E-mail<br> <a href=″mailto:[email protected]”> </body> </html> Q8. Explain <img> tag with its attributes. OR How images and pictures are handled in HTML? What are the formats best suited for web designing? Ans. To insert image in html document we have to use <img> tag in html document. The <img> tag is an empty tag i.e. it doesn’t require closing tag. Syntax: <img src=”url” alt=”alternative text”> The attributes of <img> tag are: 1. Src: - Defines the url of the image. The commonly used image file types are GIF and JPEG. 2. Alt: - When the picture is not available that you specify in the src attribute then the text/ image text you mention in alt is displayed. 3. Height and width: - These attributes are used to set the height and width of an image. The values can be given in pixels and percentage. 4. Align: - Horizontally image can be aligned to left, center and right. 5. Valign: - Vertically image can be aligned to the top, middle and bottom. 6. Border: - By default no border appears around an image unless that image is link. You can specify the border for an image by using “ border” attribute. 7. Vspace: - The Vspace attribute is used to insert space on top and bottom. 8. Hspace: - The Hspace attribute is used to insert space on left and right. Various formats used are: GIF stands for Graphic Interchange Format. It is a bitmap image format that was introduces by CompuServe in 1987. It supports up to 8 bits per pixel. The colors are chosen from the 24-bit RGB colors space. It contains 256 or fewer colors for each frame. Some good examples are cartoon art, clip art6, black and white images or images with many solid color areas. The color limitation makes the GIF format unsuitable for reproducing color photographs. But it is well suited for simpler images such as graphics. JPEG stands for Joint Photographic Experts Group. JPEG images are best for photographic quality because they can display true color image to great effect. It is capable of displaying more than 256 colors. This is the right format for those images which must be very small files e.g. for web sites or email. Image quality is decrease when the JPG data is compressed and quality can Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 31 of 46 never be recoverable. JPG is often used on digital camera memory cards. JPG compression has very high efficiency. Q9. What are different types of image, we can use on a web page? Discuss their main features. Ans:- 1. BMP: – Bitmap Images 2. JPG (jpeg): - Joint Photo Graphic Expert Group 3. GIF: - Graphics Interchange Format 4. TIF /Tiff: - Tagged Image File Format 5. PNG: - Portable Network Graphics. 1) BMP (Bitmap Image): - A bitmap is a file format for images stored in a computerized form. It’s extension “.bmp” .Computer use bits of 1 and 0 to store data (image).A bitmap is literally a map of bits that form a particular picture. In a bmp image, each pixel is assigned at least one bit. Bmp images takes much space that’s why we commonly don’t use ‘. Bmp’ images. Each pixel in the bitmap might have 16,24,or 48 bits of information associated with it. The more bits, the greater resolution of bitmap and the larger file. Because bitmap store so much information in the highest resolution, they make very beautiful image. However, a bitmap image doesn’t rescale well. It loses clarity. Zooming on a bitmap image in any graphics program allows user to add, delete, or change color of individual pixels. Because bit map images are built pixel-by-pixel, they can be easily edited. 2) JPEG: - It is Capable at display more then 256 colors and does a better job at rendering photographs. This is the right format for those images which must be very small files, e.g. for web sites or email JPG is often used on digital cameras memory cards. JPG file is wonderfully small, often compressed to perhaps only 1/10 at the size of the original data, which is a good thing when modems are involves. Some image quality is lost when the JPG data is compressed and saved, and the quality can never be recovered. JPG compression is not loss less (means fully recoverable) JPG compression is easy. JPG compression has very high efficiency (relatively tiny files) More quality is lost every time the JPG file is compressed. 3) GIF: - Graphics Interchange Format- It is a bitmap image format that was introduces by CompuServe in 1987.It supports up to 8 bit per pixel. The colors are chosen from the 24-bit RGB color space. It support animation and allows a separate palette of 256 colors for each frame. The color limitation makes the GIF format unsuitable for reproducing color photographic. But it is well –suited for simpler image such as graphics. A GIF file describes a fixed sized graphical area populated with zero or more image. GIF files start with a fixed length header. 4) TIF/TIFF: - Tagged Image File Format-It is a file format for storing images, popular among graphic artists, the publishing industry and professional photographers in general. As of 2009, it is the under the control of Adobe System. Originally created by the company ‘Aldus’ for use with what was then called desktop publishing. TIFF is a flexible adaptable file format for handling image and data with a single file. The ability to store image data in a loss less (means without loosing image quality) format makes a TIFF/TIF file useful image. Every TIFF begins with a 2-byte indicator of byte order. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 32 of 46 Many TIFF images contains only uncompressed 32-bit (CMYK) or 24-bit (RGB) image. 5) PNG: - It’s a bitmapped image format and video code that employees loss less data compression PNG was created to improve upon and replace GIF as an image file format not requiring a patent license. PNG support palette based image (with palettes of 24-bit RGB or 32-bit RGBA colors). PNG file start with an 8-byte signature. PNG images can either use palette indexed color or be made up of one or more channels (numerical values directly representing quantities about the pixels) The number of channels will depend on whether the image in grayscale or color and whether it has an alpha channels. PNG itself doesn’t support animation at all. MNG is an extension to PNG that does, it designed by member the PNG group. Q10. Where we use computers in business? OR How Internet facilities are more useful to Business organizations? OR How computer can be enhancing productivity in business? Explain in detail. Ans. These days computers can be used for followings fields: 1. Resources Management: - Material management information system comes under Transaction Processing system. Obviously all information systems (under management information system) require computers to process. 2. Production planning and control: - It is use planning of a part or product in manufacturing. 3. Credit and collection: - A credit and collections agent handles the billing and collections for a company or organization. 4. Warehousing: - With the growing demand of these computers many multi- national firms started to invest more and more in opening Computer Warehouses or storehouses. 5. Marketing information systems: - A management information system (MIS) is a system that provides information needed to manage organizations effectively. 6. Manufacturing information systems: - Manufacturing is the transformation of raw materials into finished goods for sale or intermediate processes involving the production. It is a large branch of industry and of secondary production. 7. Multimedia: - Multimedia is usually recorded and played, displayed or accessed by information content processing devices, such as computerized and electronic devices, but can also be part of a live performance. Multimedia also describes electronic media devices used to store and experience multimedia content. 8. Science and technology: - Computer science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems. 9. Banks: - Banks are using special software packages for monitoring their working. At any point of time the concerned authority can have details of cash deposits, cheque deposits, overdrafts, interest charges on the loan amount etc. in a matter of minutes. 10. Schools: - School are using special software packages for fee administration, finance, transport, time scheduling, payroll, record of students and performance of teachers. 11. Recruit New employee: - New employees can be recruit (hire) using internet. Interview is taken on internet and it saves money and time. 12. Provide Products information: - Companies can provide information about their products using internet, that information can be seen by anyone, who use internet. 13. Reach a worldwide audience: - when we use internet, there is no limite. We can contact with other people worldwide and tell them about our business, products etc. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 33 of 46 Q11. Explain the method and action attributes of form. Or What is <form> tag? What are the different methods used in form? Ans. Forms collect data from the user and post it back to the server for processing. For Communicating with User we use Forms. Form tag is used to take information from the user at run time. Method:- The method property of a form is used to specify the method used to send data captured by various form elements back to the web server. The method used can either be 1. Get 2. Post. Method="GET" is used if you want to send information somewhere via a browser URL. You've seen URLs that send information; they look something like: http://domain.com/abc.asp?color=red&shape=round In the above URL, the part after the question mark is information sent to abc.asp. Multiple information chunks are separated with an ampersand. The GET method can send only a limited amount of information. The limitation depends on the server where the current web page is on and the server where the information is sent to. Sending With Method POST method="POST" is the most common method used to send information from a form to an information processing program or function. This is the method used when sending form information to JavaScript functions. Most CGI programs are written to accept information with the POST method, some to accept only the POST method. The POST method can send much more information than the typical GET method. Currently, most browsers and servers limit the amount of POST information to about 32k. With POST, the information is not sent via the URL. The sending is invisible to the site visitor. These elements allow the user to provide information to the website - information which can be submitted to the server for processing. Action. Action attribute of the <form> </form> tags is used to define URL (address) where the information (data) is sent by the browser and web server that will process the form data captured and being sent back. The server side program that processes this data can be written in any scripting language that the web server understands. Q12. Explain selection lists. Ans:- Selection lists:- Selection list is used to make selection from the given items. Both scrolling lists and pull-down pick lists are created with the <select> tag. You use this tag together with the <option>tag: <select> <option>electric windows</option> <option> fm radio</option> <option>turbocharger</option> </select> It has three attributes: Name: used to specify name of list Size: it displays the limited items in the list. If size is 3 it displays the 3 items in the list, pressing shows other by scroll button. Multiple: by using this attribute we can select multiple options from the list, if value is true. E.g. <html> <body> <select name=hobbies size=3 multiple=”true”> <option> value=p>painting</option> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 34 of 46 <option> value=h>hockey</option> <option> value=d>dancing</option> <option> value=r>reading</option> </select> </body> </html> Q13. What are lists? Explain the various types of lists with example. Ans. Lists: - A series of names, words or other items written in sequence (one after the other) order are called lists. E.g. A shopping list. A guest list etc. There are three types of lists: 1. Ordered list 2. Unordered list 3. Definition list Ordered list: - List items that have a specific numerical order or ranking is called ordered list. Sometimes ordered list is called numbered list. Ordered lists can be nested. An ordered list must begin with the <OL> element, which is immediately followed by a <LI> (list item) element. Syntax: <ol> <li>item 1</li> <li>item 2</li> ----------------</ol> Example: <OL> <LI>PGDCA</LI> <LI>MSc IT</LI> <LI>MCA</LI> </OL> The attributes that can be used with ordered list are: 1. Type 2. Start Type can take values 1, A, a, I, i By default ordered list starts from numeric digits. Unordered list: - The bulleted list is called an unordered list. It looks like an ordered list except that bullets appear at each tag instead of numbers An unordered list must begin with the <UL> element which is immediately followed by a <LI> (list item) element. Unordered lists can be nested. Syntax: <ul> <li>item 1</li> <li>item 2</li> ----------------</ul> Example: <UL> <LI>First list item</LI> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 35 of 46 <LI>Second list item</LI> <LI>Third list item</LI> </UL> The attribute that can be used in unordered list is: 1. Type Type can take values circle, square, disc. Example: <UL type=square> <LI>Patiala</LI> <LI>Samana</LI> <LI>Talwandi Malik</LI> </UL> By default unordered list display data as fill circle (disc) format. Definition list: - The list of terms and their meaning is called definition list. It is without any numbers or symbols in front of each line. Line break and indentation appears automatically. Basically a definition list is composed of three HTML elements and some text. These are the <DL>, <DT> and <DD> elements. It starts with <dl> tag and ends with </dl> tag. 1. Definition List <DL> 2. Definition Term <DT> 3. Definition Description <DD> Syntax: <dl> <dt>data term</dt> <dd>data description</dd> ----------------------------------</dl> Example: <DL> <DT> Keyboard</DT> <DD> An input device</DD> <DT> Printer</DT> <DD> An output device</DD> </DL> Q14. Explain attributes of Table in detail. Ans. A table is an orderly arrangement of text or graphics into vertical columns and horizontal rows. Tag Attribute Function <table>..</table> Creates a table that contains number of rows and columns. Border="......" Indicates the width in pixels of the table borders. (border="0", or omitting the border attribute, makes borders invisible Cellspacing="......" The amount of space between the cells in the table. Cellpadding="......" The amount of space between the edges of the cell and its contents. Width="......" The width of the table on the page, in either exact pixel values or as a percentage of page Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Bgcolor="...." <tr>....</tr> Align="......" Valign="......" Bgcolor="...." <td>…. </td> Align="......" Valign="......" Rowspan="..." Colspan="....." Bgcolor="...." <th>... </th> Page 36 of 46 width. Background color of all cells in the table that do not contain their own background or bgcolor attribute. Defines a table row, containing one or more cells (<td>tags) The horizontal alignment of the contents of the cells within this row. Possible values are left, right, and center. The vertical alignment of the contents of the cells within this row. Possible values are top, middle, and bottom. Background color of all cells in the row that do not contain their own background or bgcolor attributes. Defines a table data cell. The horizontal alignment of the contents of the cell. Possible values are left, right, and center. The vertical alignment of the contents of the cell. Possible values are top, middle, and bottom. The number of rows this cell will span. The number of columns this cell will span. Background color of the cell. Define a table-heading cell. Q15. What do you mean by image map? Give their advantages and disadvantages. Ans. An image map is an image with multiple click able areas. You can easily create click able images by placing them in an anchor tag (<a>). You can also create an image map where clicking on a specific part of an image redirects you to another page. An example of an image map is taking an image of world. You will have different links for different areas. In order to create an image map you need to use <map> tag. Examples for <map> The first tag to know when using image maps is the <map> tag. The example shows two frames separated by a horizontal splitter. The first frame has a height of 200px and the second frame has the remaining height of the window (*). <img src="" usemap="#name1"/> <map name="name1" id="name1"> <area href="index.aspx" shape="rect" coords="20,30,50,40" /> <area href="offer.aspx" shape="circle" coords="20,30,30" /> <area href="games.aspx" shape="poly" coords="30,40,50,60,80,70" /> </map>Welcome Attributes of Image map Name Values Name Text Description (Deprecated)The name of the image map, the value is typically used in the usemap attribute of the image tag Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 37 of 46 Attributes of <area> tag Name Values Description shape rect circle poly default shape and coords attributes are linked. Depending on the value of shape the coords attribute takes different values coords shape="rect" coords="left, top, right, bottom" shape="circ" coords="centerx, centery, radius" shape="poly" coords="x1, y1, x2, y2, ,xn,yn" the values accepted by coords depends on the shape attribute (the shape of the hotspot). All values are in pixels and comma separated. if shape is poly then the coordinates are x and y for each point of the polygon. The coords must specify in order. href url The link of the hotspot/area. When the user clicks on the hotspot the url in href will be opened in the browser window. Text a description of the hotspot or link. When the mouse hovers over a hotspot a tooltip will appear with the text from the alt attribute Alt Advantages: 1. Using image map, user can divide the single picture into multiple links. 2. Image map creation is quite simple you can place links according to your requirement. Disadvantages: 1. Image map takes only one alt tag. It is not possible to have different alt tags for different links. 2. An image map is one large image and if its not closed properly it will take a long time to download. Q16. What do you mean by DHTML and its features? What are the attributes of style? Ans. DHTML And Style Sheets DHTML - Dynamic Hypertext mark up language. When we use style sheets and JavaScript in HTML file called DHTML. DHTML sites going fast upon client-side technologies. Dynamic HTML is not really a new specification of HTML, but rather a new way of looking at and controlling the standard HTML codes and commands. When thinking of dynamic HTML, you need to remember the qualities of standard HTML, especially that once a page is loaded from the server, it will not change until another request comes to the server. Dynamic HTML give you more control over the HTML elements and allows them to change at any time, without returning to the Web server. Features of DHTML: Style sheets Absolute positioning Multimedia effects Database access facility Dynamic fonts Scripting Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 38 of 46 Style sheet - Style sheet language is used to describe the look and formatting of a document written in markup language. Style sheets are powerful way for adding styles in web documents. Style sheet gives us a greater control over the presentation of web document. It provides more flexibility and reduces complexity. Syntax: Item {property: value}; E.g. <h1 style="font: bold 100px Modern"> Vaishnoo Maa Computers </h1> There are three types of style sheets: Inline style sheet. Internal style sheet or embedded style sheet. External style sheet. Attributes of styles Style usually defines the following: Font name, size and style Text indent Margins (left and right) Background and text color Text alignment Q17. What is style sheet? How it is created? Explain with example. OR What is style sheet? Write different types of style sheets. Ans. Style sheet language used to describe the look and formatting of a document written in markup language. Style sheets are powerful way for adding styles in web documents. Style sheet give us a greater control over the presentation of web document. It provides more flexibility and reduces complexity. Syntax: Item {property: value}; There are three types of style sheet files: 1. Inline style sheet. 2. Internal style sheet or embedded style sheet. 3. External style sheet. 1. Inline style sheet - In the In-line style, the type style is defined within the body of the HTML document itself. E.g. in the paragraph tag <p> we can specify the style as follows: <h1 style="font: bold 100px Modern"> Vaishnoo Maa Computers </h1> 2. Internal style sheet - A style sheet can be fully defined in header section with the <style> and </style> tags. This way of defining style sheet is called an internal style sheet. <head> <title>CGS</title> <style> Body {font: 14px; color: black; background: orange} P {font: 12pt ” Monotype Corsiva”} H4 {font: 26pt ” Monotype Corsiva”} </style> </head> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 39 of 46 3. External style sheets - In case of an external style sheet, it is stored in a separate file. This style sheet can be linked to any number of HTML documents. We use <link> tag in header section to link a external style sheet to HTML document. <head> <LINK rel="stylesheet" type="text/css" href="exstyle.css" title="style1"> </head> Consider the style sheet “exstyle.css”, which is shown below Body {font: 14px arial; color: black;} H1 {font: bold 12pt Modern} A {text-decorator: blinking; color: green} Q18. What is the header section? What is its importance? Or Explain various tags, which are used in header section? Ans. The document between these tags shows some information about the html document such as document title. Main tags used in header section are: 1. Title <title> tag 2. Style <style> tag 3. Link <link> tag 4. Frameset <frameset> tag 5. Script <script> tag 1. The Title<title> tag - The <title> tag, which is placed between <head> and </head> tags. The title of the document is placed between <title> and </title> tags, which is displayed by browser at the top of the browser window. Syntax: <head> <title> --------</title> </head> Example: <head> <title> Vaishnoo Maa Computers </title> </head> 2. Style <style> tag – Style <style> tag is used in header section to define internal style sheet. This way of defining style sheet is called an internal style sheet. <head> <title>internal style sheet</title> <style> Body {font: 14pt”arial”; color: black; background:orange} H1 {font: 12pt”times roman” bold} P {font: 12pt”times roman”} H4 {font: 26pt”times roman”} A {text-decorator: blinking; color: green} </style></head> 3. Link <link> tag - In case of an external style sheet, it is stored in a separate file. This style sheet can be linked to any number of HTML documents. We use <link> tag in header section to link an external style sheet to HTML document. <head> <LINK rel="stylesheet" type="text/css" href="exstyle.css" title="style1"> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 40 of 46 </head> 4. Frameset <frameset> tag - This tag is included after <head> tag and it establishes frames within the html document. It used to divide the web page into many sections. It requires a closing tag and there be any number <frameset> tags within the html document. Syntax: <frameset cols=” “ rows=” “> -----------------------------------------</frameset> In following example there are only three frames: <head> <frameset cols="25%,25%,*"> <frame src="frame_a.htm" /> <frame src="frame_b.htm" /> <frame src="frame_c.htm" /> </frameset> </head> 5. Script <script> tag – Script <script> tag is used in header section to include script file in html document. E.g. java script, vb script, asp script. Example: <head> <script type=”javascript” src=”java1.js”></script> </head> Q19. Discuss all the major elements, which are used, on a web page to collect information from user. Ans. Form provides all the major elements, which are used, on a web page to collect information from user. Its elements are: 1. Inputbox – It is used to enter text from user. The input element is the most critical element for creating forms. The tag for input element is <input/>. It is a singular tag. The input tag <input/> must fall between <form> and </form> tags but it can be anywhere on the page in relation to text, image and other HTML tags. There are many attributes that can be used with <input> tag like type, size, checked, maximum length etc. But the most important attribute that can be used with <input> tag is type. It is possible to built an form using no other element except through the type attribute. General syntax of input element is: <input type=”text”|”password”|”checkbox”|”radio”|”button” name=”control name” value=”control value” size=”width value” maxlength=”word length” checked/> Example <html> <head> <title>input tag</title> </head> <body> <form method=post> Enter your name<input type=text name=”name”><br> Enter Password<input type=password name=”pass”><br> Chose your nationality<br> <input type=Radio name=r value=Indian> Indian <input type=Radio name=r value=Non-Indian>Non-Indian<br> Your hobbies<br> <input type=checkbox name=h> Horsr Riding<br> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 41 of 46 <input type=checkbox name=s> Wrestling<br> <input type=checkbox name=m>Mount Climbing <br> <input type=submit value=Submit><br> </form> </body> </html> Output: - Q20. How we can use links in frames? Ans. Links in frame are used to link document in frame area. “src” attribute is used to define url address of document. Use links in frame: First divide the screen into frames. Suppose we have divided the screen into two frames. frame.html <html> <head> <title>frame</title> </head> <frameset cols="50%,50%"> <frame src="link.html" name=rtframe> <frame src="link1.html" name=ltframe> </frameset> </html> Now we link the documents in the frame. link.html <html> <body> <a href="p.html" target="rtframe">Open link.html file</a> </body> </html> link1.html <html> <body> <a href="text.html" target="ltframe"> Open link1.html file </a> </body> </html> Output of frame.html file is: Open link.html file Open link1.html file Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 42 of 46 Q21. Suppose you have your own website. Create a form in your website, to get response from users that what they think about your website. Ans. <HTML> <HEAD> <TITLE>Example1</TITLE> </HEAD> <BODY> <H1>My Guest Book</H1> <P>Please let me know what you think of my Web pages. Thanks!</p> <FORM> <INPUT type = "hidden" name = "success"> <PRE> What is your name? <INPUT type=”text” size = "28" name = "fullname"> Your e-mail address: <INPUT type=”text” size = "25" name = "e-address"> </PRE> <P> Check all that apply: <BR> <INPUT type = "checkbox" CHECKED name = "like it"> I really like your Web site.<BR> <INPUT type = "checkbox" name = "best"> One of the best sites I've seen.<BR> <INPUT type = "checkbox" name = "envy"> I sure wish my pages looked as good as yours.<BR> </P><P> Choose the one thing you love best about my pages:<BR> <INPUT type = "radio" CHECKED value = "me" name = "love best"> Easy to explore & user friendly. <BR> <INPUT type = "radio" value = "treasures" name = "love best"> No hidden cost. </P> <P> <P>Feel free to type more praise, marriage proposals, gift offers, etc. below:<BR> <TEXTAREA name = "comments" rows = "4" cols = "55"> </TEXTAREA> <br><br><br> <INPUT type = "submit" value="Click Here to Submit"><INPUT type = "reset" value = "Erase and Start Over"> </P> </FORM> <br> </BODY> </HTML> Q22. What is Frame and Frameset? What is the difference between frame and frameset. Ans:- Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles is called a "frame". Frames can divide the screen into separate windows. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 43 of 46 Frame 1 Frame 2 Each of these windows can contain an HTML document. HTML frames allow authors to present documents in multiple views, which may be independent windows or subwindows. Several web pages can be displayed in the same browser window. It does not have a closing tag. <frame src=”url”> src attribute accepts the url of the frame content. Frameset :-This tag is included after <head> tag and it establishes frames within the html document. It does all the dividing. It requires a closing tag and there be any number <frameset> tags within the html document. Syntax: <frameset cols=" " rows=" "> <frame src="url"> -----------------------------------------</frameset> Frame Frameset Set the limits of a single frame, or area, The <frameset> tag defines how to divide the window within the frameset. A separate into frames. Each frameset defines a set of rows or document linked with the src attribute columns. The values of the rows/columns indicate the appears inside frame. amount of screen area each row/column will occupy. E.g. <frame src=”home.html”> E.g. <frameset cols="25%,*,25%"> It does not have a closing tag. It requires a closing tag. Q23:- Write an HTML code to display the following in the browser 1. 2. Ans:- Output Devices Monitor Printer A. B. Speaker Input Devices o Mouse o Scanner I. II. o Keyboard Impact printer Non-impact printer Flatbed Scanner Photo Scanner <html> <body> <ol type=1> <li>Output Device</li> <ul type=disc> <li>Monitor</li> <li>Printer</li> <ol type=A"> <li> Impact Printer</li> <li>Non-Impact Printer</li> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 44 of 46 </ol> <li>Speaker</li> </ul> <li>Input Device</li> <ul type=circle> <li>Mouse</li> <li>Scanner</li> <ol type=I> <li>Flatbed Scanner</li> <li>Photo Scanner</li> </ol> <li>Keyboard</li> </ul> </ol> </body> </html> Q24. Explain any five tags in HTML with the help of examples? Ans. 1. <HR> tag : - The HTML Horizontal Rule <hr> tag is used to draw a straight horizontal line in HTML document. This horizontal line appears in web browsed using HTML hr tag. Attributes of <hr> tag: Width: Width attribute of hr tag accepts value as pixels for example width="80" will display the horizontal line with width of 80 pixels. Size: Size attribute of hr tag also takes the value as pixels to control the height of horizontal line. Color: Color attribute of hr tag accepts the hex code or name of the color to apply the background color of horizontal line. align: align attribute takes 3 values as left, center or right to align the position of horizontal rule. Effect of align attribute is visible only if width of hr tag is less than the width of client width of web browser. Example <html> <head> <title> multi line text</title> </head> <body> my name is meenakshi <br> i am doing BCA <hr> <br> Form PTU <hr> <br> Patiala <hr> </body> </html> 2. Heading tags : - HTML has six levels of headings, numbered 1 to 6. Headings are typically displayed in larger and/or bolder fonts than normal body text. The first heading in each document should be tagged <H1>. It is the biggest heading. And <h6> is the smallest heading. The syntax of the heading element is<H1> Text of heading </H1> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 45 of 46 Now we learn about heading tag. This tag is used to give headings in page. The <h1> to <h6> tags are used to define HTML headings. Example <html> <head> <title> use line for write pages</title></head> <body> <h1> Punjab Technical University</h1> <h2> starts distance learning program </h2> <h4> in punjab </h4> <h6> by newpaper </h6> </body> 3. <marquee> tag : - It is possible to create a scrolling text or scrolling image using the <marquee> tag which is a non-standard HTML element. The <marquee> tag causes automatic scrolling of text or just like any other HTML tag. The <marquee> tag is also associated with attributes. There is a complete list of attributes that the <marquee>tag supports: Attributes of <marquee> tag. 1. bgcolor 2. behavior types of behavior:- alternate,scroll,slide 3. direction 4. loop 5. scrollamount Example <html> <head> <title> WWW.MYDreams.com</title> </head> <body> <marquee bgcolor=red direction=up behavior= alternate >PTU</marquee> </body> </html> 4. <font> tag : - The <font> tag is used to change the format of the text on the web page. The most important attributes are as follows: face: The type of font. Common ones include "Time New Roman", "Verdana", and helvetica." size: This indicates the size of the text. This can be absolute (0 .. 6), or relative ("+1", ... or "1",...) color: This attribute indicates the color of the text. Either the color name or the six-character color code may be used to specify color. Example <html> <body> <font size=2 face="Helvetica" color=red>Welcome to HTML</font> </body> </html> 5. <pre> : - Pre-Formatted text option allows you to type out text which will appear on the webpage just the way you typed it in your html document. Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100 SUBJECT: ‘HTML’ (B.Sc.-IT - 2) Page 46 of 46 (1) To use the pre-formatted text option begins by typing <pre> in your html document. (2) Continue by typing out the text in the way you want it to appear on your page. (3) Conclude by typing </pre> Example <html> <body> <pre> HELLO Here is an example of pre-formatted text. This line is indented in the html document and Appears just as it is typed in the webpage. The end. THANKS </pre> </body> </html> Prepared By: - Vaishnoo Maa Computers, SCO 145, Chotti Baradari, Patiala. Ph. 0175-2205100, 2215100
© Copyright 2025 Paperzz