• +91 9971497814
  • info@interviewmaterial.com

HTML Interview Questions Answers

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

Answer 1 : 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 &-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 2 : How do I create a link that sends me email?

Answer 2 : Some examples, with actual HTML Code included, follow: Simple MailTo <a href="mailto:info@exammaterial.com"> MailTo with Multiple Recipients <a href="mailto:info@exammaterial.com,info@exammaterial.com"> MailTo with Subject <a href="mailto:info@exammaterial.com?subject=Comments from MailTo Syntax Page"> MailTo with a Copy <a href="mailto:info@exammaterial.com?cc=support@exammaterial.com"> MailTo with a Blind Copy <a href="mailto:info@exammaterial.com?bcc=support@exammaterial.com"> MailTo with message already started in Body <a href="mailto:info@exammaterial.com?body=I am having trouble finding information on "> MailTo with multiline message in Body <a href="mailto:info@exammaterial.com?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph."> NOTE: Use "%0A" for a new line, use "%0A%0A" for a new line preceded by a blank line. Features may be used in combination MailTo with Subject, a Recipient, a Copy and a Blind Copy <a href="mailto:info@exammaterial.com?subject=MailTo Comments&cc=ASTARK1@UNL.EDU&bcc=id@internet.node"> Remember to use only one ? (question mark), when providing multiple entries beyond e-mail address

Question 3 : How do I make a form so it can be submitted by hitting ENTER?

Answer 3 : The short answer is that the form should just have one <INPUT TYPE=TEXT> and no TEXTAREA, though it can have other form elements like checkboxes and radio buttons.

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

Answer 4 : <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 5 : Is there a way to prevent getting framed?

Answer 5 : "Getting framed" refers to having your documents displayed within someone else's frameset without your permission. This can happen accidentally (the frameset author forgot to use TARGET="_top" when linking to your document) or intentionally (the frameset author wanted to display your content with his/her own navigation or banner frames). To avoid "framing" other people's documents, you must add TARGET="_top" to all links that lead to documents outside your intended scope. Unfortunately, there is no reliable way to specify that a particular document should be displayed in the full browser window, rather than in the current frame. One workaround is to use <BASE TARGET="_top"> in the document, but this only specifies the default target frame for links in the current document, not for the document itself. If the reader's browser has JavaScript enabled, the following script will automatically remove any existing framesets: <script type="text/javascript"> if (top.frames.length!=0) { if (window.location.href.replace) top.location.replace(self.location.href); else top.location.href=self.document.href; } </script> An alternative script is <script type="text/javascript"> function breakOut() { if (self != top) window.open("my URL","_top",""); } </script> </HEAD> <BODY onLoad="breakOut()">

Question 6 : How can I copy something from a webpage to my webpage?

Answer 6 : 1: Plaintext or any text information viewable from your browser can be easily copied like any other text from any other file. 2; HTML and web scripts - you will need to view the web page's source code. In the page's source code, copying the <script> and </script> tags as well as all the information in-between these tags will usually enable the script to work on your web page. 3: Images, sounds, or movies - Almost all images, sounds, and movies can be copied to your computer and then viewed on your webpage. Images can be easily copied from a webpage by right-clicking an image and selecting "Save Picture as" or "Save Image as". Unless the sound or movies file has a direct link to download and save the file to a specified location on your hard disk drive or to view your Internet browser's cache and locate the sound or movie file saved in the cache. 4. Embedded objects - Looking at the source code of the object to determine the name of the file and how it is loaded, and copy both the code and the file.

Question 7 : What is a Hypertext link?

Answer 7 : A hypertext link is a special tag that links one page to another page or resource. If you click the link, the browser jumps to the link's destination.

Question 8 : What is a DOCTYPE? Which one do I use?

Answer 8 : According to HTML standards, each HTML document begins with a DOCTYPE declaration that specifies which version of HTML the document uses. Originally, the DOCTYPE declaration was used only by SGML-based tools like HTML validators, which needed to determine which version of HTML a document used (or claimed to use). Today, many browsers use the document's DOCTYPE declaration to determine whether to use a stricter, more standards-oriented layout mode, or to use a "quirks" layout mode that attempts to emulate older, buggy browsers.

Question 9 : What is an HTML tag ?

Answer 9 : 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 10 : How do I keep people from stealing my source code and/or images?

Answer 10 : Because copies of your HTML files and images are stored in cache, it is impossible to prevent someone from being able to save them onto their hard drive. If you are concerned about your images, you may wish to embed a watermark with your information into the image. Consult your image editing program's help file for more details. The colors on my page look different when viewed on a Mac and a PC. The Mac and the PC use slightly different color palettes. There is a 216 "browser safe" color palette that both platforms support; the Microsoft color picker page has some good information and links to other resources about this. In addition, the two platforms use different gamma (brightness) values, so a graphic that looks fine on the Mac may look too dark on the PC. The only way to address this problem is to tweak the brightness of your image so that it looks acceptable on both platforms.

HTML Contributors


Share your email for latest updates


Our partners