• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

HTML Interview Questions Answers

Question - 51 : - How do I center a table?

Answer - 51 : - In your HTML, use <div class="center"> <table>...</table> </div> In your CSS, use div.center { text-align: center; } div.center table { margin-left: auto; margin-right: auto; text-align: left; }

Question - 52 : - How to transferring user to new web page automatically?

Answer - 52 : - You will need to use the below meta tag. <META HTTP-EQUIV="Refresh" CONTENT="2"; URL="http://www.yourname.com"> Placing the above tag in your <HEAD></HEAD> will load yousite.com in 2 seconds. Changing the 2 value on CONTENT="2" to another value will increase or decrease the delay until loading the new page. I'm trying to `include' a HTML document in another document...Is there a way to do this? Yes, there are several ways to do this. But remember, HTML is not a programming language - it doesn't have `directives': it's a markup language, so trying to compare it to C or Pascal is not going to be very meaningful. SGML already provides the standard way to do this, using an entry in the DocType Declaration for a file: <!doctype html public "-//IETF//DTD HTML 3.0//EN" [ <!entity foo system "bar.html"> ]> ... and then later when you want to include the file ... &foo; This is the General Entity mechanism used universally in normal SGML work and does exactly what is wanted, with the added benefit that you can have multiple occurrences of &foo; if you need to include some text at more than one place. Unfortunately none of the browsers except Panorama support it, basically because very few of the programmers who write browsers bothered to read up on what can be done. * The second way is to use the facilities of your server. This has to be enabled by someone with access to the server configuration files (ask your WebMeister). For example, the NCSA server lets you embed a command inside an SGML comment: <!--#exec cmd="cat myfile.html"--> Provided this occurs in a file with a special file type (eg .shtml, and this is what has to be specified in the server configuration), the server will parse the file and send out the result of the command embedded in the document. * There is in fact a vastly easier way to do this. SGML provides a PI mechanism (Processing Instruction) in the form: <?cat myfile> SGML/HTML couldn't care what you put inside (except it must not, for obvious reasons, contain the `>' character!). This would be a

Question - 53 : - What is HTML?

Answer - 53 : - HTML, or HyperText Markup Language, is a Universal language which allows an individual using special code to create web pages to be viewed on the Internet. HTML ( H yper T ext M arkup L anguage) is the language used to write Web pages. You are looking at a Web page right now. You can view HTML pages in two ways: * One view is their appearance on a Web browser, just like this page -- colors, different text sizes, graphics. * The other view is called "HTML Code" -- this is the code that tells the browser what to do.

Question - 54 : - Why aren't my frames the exact size I specified?

Answer - 54 : - Older versions of Netscape Navigator seems to convert pixel-based frame dimensions to whole percentages, and to use those percentage-based dimensions when laying out the frames. Thus, frames with pixel-based dimensions will be rendered with a slightly different size than that specified in the frameset document. The rounding error will vary depending on the exact size of the browser window. Furthermore, Navigator seems to store the percentage-based dimensions internally, rather than the original pixel-based dimensions. Thus, when a window is resized, the frames are redrawn based on the new window size and the old percentage-based dimensions. There is no way to prevent this behavior. To accommodate it, you should design your site to adapt to variations in the frame dimensions. This is another situation where it is a good idea to accommodate variations in the browser's presentation.

Question - 55 : - Is there a site that shows which tags work on which browsers?

Answer - 55 : - There have been several attempts to do this, but I'm not aware of any really good source of comparisons between the browsers. The trouble is that there are many different versions of each browser, and many different tags. All current browsers should support the tags in the official HTML 3.2 specification, but the major ones also support nonstandard tags and sometimes have slightly different implementations. One place that has fairly good compatibility info is Browsercaps.

Question - 56 : - How do I use forms?

Answer - 56 : - The basic syntax for a form is: <FORM ACTION="[URL]">...</FORM> When the form is submitted, the form data is sent to the URL specified in the ACTION attribute. This URL should refer to a server-side (e.g., CGI) program that will process the form data. The form itself should contain * at least one submit button (i.e., an <INPUT TYPE="submit" ...> element), * form data elements (e.g., <INPUT>, <TEXTAREA>, and <SELECT>) as needed, and * additional markup (e.g., identifying data elements, presenting instructions) as needed.

Question - 57 : - Which should I use, &entityname; or &#number; ?

Answer - 57 : - In HTML, characters can be represented in three ways: 1. a properly coded character, in the encoding specified by the "charset" attribute of the "Content-type:" header; 2. a character entity (&entityname;), from the appropriate HTML specification (HTML 2.0/3.2, HTML 4, etc.); 3. a numeric character reference (&#number;) that specifies the Unicode reference of the desired character. We recommend using decimal references; hexadecimal references are less widely supported. In theory these representations are equally valid. In practice, authoring convenience and limited support by browsers complicate the issue. HTTP being a guaranteed "8-bit clean" protocol, you can safely send out 8-bit or multibyte coded characters, in the various codings that are supported by browsers. A. HTML 2.0/3.2 (Latin-1) By now there seems no convincing reason to choose &entityname; versus &#number;, so use whichever is convenient. If you can confidently handle 8-bit-coded characters this is fine too, probably preferred for writing heavily-accented languages. Take care if authoring on non-ISO-8859-based platforms such as Mac, Psion, IBM mainframes etc., that your upload technique delivers a correctly coded document to the server. Using &amp;-representations avoids such problems. B. A single repertoire other than Latin-1 In such codings as ISO-8859-7 Greek, koi8-r Russian Cyrillic, and Chinese, Japanese and Korean (CJK) codings, use of coded characters is the most widely supported and used technique. Although not covered by HTML 3.2, browsers have supported this quite widely for some time now; it is a valid option within the HTML 4 specifications--use a validator such as the WDG HTML Validator or the W3C HTML Validation Service which supports HTML 4 and understands different character encodings. Browser support for coded characters may depend on configuration and font resources. In some cases, additional programs called "helpers" or "add-ins" supply virtual fonts to browsers. "Add-in" programs have in the past been used to support numeric references to 15-bit or 16-bit code protocols such as Chinese Big5 or Chinese GB2312. In theory you should be able to include not only coded characters but also Unicode numeric character references, but browse

Question - 58 : - How do I create a link?

Answer - 58 : - Use an anchor element. The HREF attribute specifies the URL of the document that you want to link to. The following example links the text "Web Authoring FAQ" to <URL:http://www.htmlhelp.com/faq/html/>: <A HREF="http://www.yoursite.com/faq/html/">Web Authoring FAQ</A>

Question - 59 : - How do I eliminate the blue border around linked images?

Answer - 59 : - In your HTML, you can specify the BORDER attribute for the image: <a href=...><img src=... alt=... border="0"></a> However, note that removing the border that indicates an image is a link makes it harder for users to distinguish quickly and easily which images on a web page are clickable.

Question - 60 : - Is it possible to make the HTML source not viewable?

Answer - 60 : - In short, there is no real method or script for making standard HTML source code not viewable. You may consider doing any of the below if they are concerned about your source code. 1. Create the web page in Macromedia Flash or a similar program. The visitor would need to download the Macromedia Flash plug-in and would be unable to view the source code for the flash applet. 2. There are various scripts that will disable the right click feature, preventing the user from saving images or viewing the source. However, this will not protect the source code of your page. For example, Internet Explorer users may still click "View" and "Source" to view the source code of the page, or a user could disable scripts and images can be saved by simply saving the web page to the hard drive. 3. There are several programs that will help scramble your code, making it difficult (not impossible) to read. Again, this is not going to prevent someone from viewing your code.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners