• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

HTML Interview Questions Answers

Question - 41 : - What is an HTML tag ?

Answer - 41 : - An HTML tag is a syntactical construct in the HTML language that abbreviates specific instruction to be executed when the HTML script is loaded into a Web brower. It is like a method in Java, a function in C++, a procedure in Pascal, or a routine in FORTRAN.

Question - 42 : - How can I use forms for pull-down navigation menus?

Answer - 42 : - There is no way to do this in HTML only; something else must process the form. JavaScript processing will work only for readers with JavaScript-enabled browsers. CGI and other server-side processing is reliable for human readers, but search engines have problems following any form-based navigation.

Question - 43 : - How can I eliminate the extra space after a </form> tag?

Answer - 43 : - HTML has no mechanism to control this. However, with CSS, you can set the margin-bottom of the form to 0. For example: <form style="margin-bottom:0;" action=...> You can also use a CSS style sheet to affect all the forms on a page: form { margin-bottom: 0 ; }

Question - 44 : - When I try to upload my site, all my images are X's. How do I get them to load correctly?

Answer - 44 : - They are a few reasons that this could happen. The most common are: 1. You're attempting to use a .bmp or .tif or other non-supported file format. You can only use .gif and .jpg on the web. You must convert files that are not .gif or .jpg into a .gif or .jpg with your image/graphics program. 2. You've forgotten to upload the graphic files. Double-Check. 3. You've incorrectly linked to the images. When you are starting out, try just using the file name in the <img> tag. If you have cat.jpg, use img src="cat.jpg">. 4. Image file names are case-sensitive. If your file is called CaT.JpG, you cannot type cat.jpg, you must type CaT.JpG exactly in the src. 5. If all of the above fail, re-upload the image in BINARY mode. You may have accidentally uploaded the image in ASCII mode.

Question - 45 : - How do I make a thumbnail for my image(s)?

Answer - 45 : - Thumbnails are very useful, but they take a little bit of time to make. All you need is a graphics editing program that has functions to resize an image (sometimes it's under a function called image attributes). Be advised--when you have made a thumbnail, you will need to save it as something different than the original. Also, you will generally want to link to the larger graphic when you are done. Here are the steps: 1. Load a copy of the image into your graphics editing program. 2. Determine the ratio the thumbnail to be. (Do you want it to be half the size? One third of the size? One quarter of the size? One tenth of the size?) 3. Find the resize (or change attributes) function of your program. Most programs will recogize a percentage, for example you can type in 25% for height and width if you want the thumbnail to be a quarter of the size. (It it doesn't do percentages, you can calculate it by multiplying the pixels by the percentage. If you have a graphic that is 400 by 100, and you want it 25% of the size, multiple each measurement by .25. In this case, you'll get 100 and 25.) 4. Once you are satisfied with the thumbnail, think of a name for the image. Choose Save As and enter that name. (Tip: I like to just add t after the image name. For taco.jpg I'd use tacot.jpg) 5. Upload the image to your site, and edit your HTML to load the new image name with the new, smaller size. If you wish, you can link to the larger image around the image. Example: You have taco.jpg which is 400 pixels wide and 100 pixels high. You made a thumbnail of it called tacot.jpg, which is now 100 pixels wide and 25 pixels high. After you have both images uploaded, here's the code: <a href="taco.jpg"><img src="tacot.jpg" width=100 height=25 border=0 alt="click for larger taco"></a> You'll find border=0 to be helpful in eliminating a link-colored box around your thumbnail.

Question - 46 : - How do you create tabs or indents in Web pages?

Answer - 46 : - There was a tag proposed for HTML 3.0, but it was never adopted by any major browser and the draft specification has now expired. You can simulate a tab or indent in various ways, including using a transparent GIF, but none are quite as satisfactory or widely supported as an official tag would be. My page looks good on one browser, but not on another. There are slight differences between browsers, such as Netscape Navigator and Microsoft Internet Explorer, in areas such as page margins. The only real answer is to use standard HTML tags whenever possible, and view your pages in multiple browsers to see how they look.

Question - 47 : - How do I make a frame with a vertical scrollbar but without a horizontal scrollbar?

Answer - 47 : - The only way to have a frame with a vertical scrollbar but without a horizontal scrollbar is to define the frame with SCROLLING="auto" (the default), and to have content that does not require horizontal scrolling. There is no way to specify that a frame should have one scrollbar but not the other. Using SCROLLING="yes" will force scrollbars in both directions (even when they aren't needed), and using SCROLLING="no" will inhibit all scrollbars (even when scrolling is necessary to access the frame's content). There are no other values for the SCROLLING attribute.

Question - 48 : - How do I create a link that opens a new window?

Answer - 48 : - <a target="_blank" href=...> opens a new, unnamed window. <a target="example" href=...> opens a new window named "example", provided that a window or frame by that name does not already exist. Note that the TARGET attribute is not part of HTML 4 Strict. In HTML 4 Strict, new windows can be created only with JavaScript. links that open new windows can be annoying to your readers if there is not a good reason for them.

Question - 49 : - How do I update two frames at once?

Answer - 49 : - There are two basic techniques for updating multiple frames with a single link: The HTML-based technique links to a new frameset document that specifies the new combination of frames. The JavaScript-based solution uses the onClick attribute of the link to update the additional frame (or frames). The HTML-based technique can link to a new frameset document with the TARGET="_top" attribute (replacing the entire frameset). However, there is an alternative if the frames to be updated are part of a nested frameset. In the initial frameset document, use a secondary frameset document to define the nested frameset. For example: <frameset cols="*,3*"> <frame src="contents.html" name="Contents"> <frame src="frameset2.html" name="Display"> <noframes> <!-- Alternative non-framed version --> </body></noframes> </frameset> A link can now use the TARGET="Display" attribute to replace simultaneously all the frames defined by the frameset2.html document. The JavaScript-based solution uses the onClick attribute of the link to perform the secondary update. For example: <a href="URL1" target="Frame1" onClick="top.Frame2.location='URL2';">Update frames The link will update Frame1 with URL1 normally. If the reader's browser supports JavaScript (and has it enabled), then Frame2 will also be updated (with URL2).

Question - 50 : - Why is there extra space before or after my table?

Answer - 50 : - This is often caused by invalid HTML syntax. Specifically, it is often caused by loose content within the table (i.e., content that is not inside a TD or TH element). There is no standard way to handle loose content within a table. Some browsers display all loose content before or after the table. When the loose content contains only multiple line breaks or empty paragraphs, then these browsers will display all this empty space before or after the table itself. The solution is to fix the HTML syntax errors. All content within a table must be within a TD or TH element.

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners