• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

HTML Interview Questions Answers

Question - 71 : - Why does the browser show my plain HTML source?

Answer - 71 : - If Microsoft Internet Explorer displays your document normally, but other browsers display your plain HTML source, then most likely your web server is sending the document with the MIME type "text/plain". Your web server needs to be configured to send that filename with the MIME type "text/html". Often, using the filename extension ".html" or ".htm" is all that is necessary. If you are seeing this behavior while viewing your HTML documents on your local Windows filesystem, then your text editor may have added a ".txt" filename extension automatically. You should rename filename.html.txt to filename.html so that Windows will treat the file as an HTML document.

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

Answer - 72 : - 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 - 73 : - How do I make a form so it can be submitted by hitting ENTER?

Answer - 73 : - 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 - 74 : - How do I put sounds for older versions of Internet Explorer?

Answer - 74 : - For older versions of Internet Explorer, this technique was used <BG SOUND="sound.ext">. Can I use any HTML in the box? Yes. Any HTML tag that your browser supports will work in the box. So you can carry tags from chapters to chapters and mix and match...

Question - 75 : - Should I put quotes around attribute values?

Answer - 75 : - It is never wrong to quote attribute values, and many people recommend quoting all attribute values even when the quotation marks are technically optional. XHTML 1.0 requires all attribute values to be quoted. Like previous HTML specifications, HTML 4 allows attribute values to remain unquoted in many circumstances (e.g., when the value contains only letters and digits). Be careful when your attribute value includes double quotes, for instance when you want ALT text like "the "King of Comedy" takes a bow" for an image. Humans can parse that to know where the quoted material ends, but browsers can't. You have to code the attribute value specially so that the first interior quote doesn't terminate the value prematurely. There are two main techniques: * Escape any quotes inside the value with &#34; so you don't terminate the value prematurely: ALT="the &#34;King of Comedy&#34; takes a bow". * Use single quotes to enclose the attribute value: ALT='the "King of Comedy" takes a bow'. Both these methods are correct according to the specification and are supported by current browsers, but both were poorly supported in some earlier browsers. The only truly safe advice is to rewrite the text so that the attribute value need not contain quotes, or to change the interior double quotes to single quotes, like this: ALT="the 'King of Comedy' takes a bow". Posting Copy and Paste HTML For those wanting to post direct Copy and Paste HTML on screen without the use of spaces or *s etc. and the need to explain those substitutions: Use &lt; to substitute for each opening tag < in each tagged set of HTML. Example, typing the following: &lt;a href="http://www.yourname.com">&lt;img src="http://pics.yourname.com/aw/pics/mask.gif">&lt;/a> Will show up on screen as: <a href="http://www.yourname.com"><img src="http://pics.yourname.com/aw/pics/mask.gif"></a> HTML for Lists 1. Bulleted Lists: <ul> begins a bulleted, indented list. Each item in the list is then prefaced with the <li> tag. It is not necessary to insert a break at the end of each line -- the <li> tag automatically creates a new line. * wit

Question - 76 : - How do I make sure my framed documents are displayed inside their frameset?

Answer - 76 : - When the sub-documents of a frameset state are accessed directly, they appear without the context of the surrounding frameset. If the reader's browser has JavaScript support enabled, the following script will restore the frameset: <SCRIPT TYPE="text/javascript"> if (parent.location.href == self.location.href) { if (window.location.href.replace) window.location.replace('frameset.html'); else // causes problems with back button, but works window.location.href = 'frameset.html'; } </SCRIPT> A more universal approach is a "restore frames" link: <A HREF="frameset.html" TARGET="_top">Restore Frames Note that in either case, you must have a separate frameset document for every content document. If you link to the default frameset document, then your reader will get the default content document, rather than the content document he/she was trying to access. These frameset documents should be generated automatically, to avoid the tedium and inaccuracy of creating them by hand. Note that you can work around the problem with bookmarking frameset states by linking to these separate frameset documents using TARGET="_top", rather than linking to the individual content documents.

Question - 77 : - How comfortable are you with writing HTML entirely by hand?

Answer - 77 : - Very. I don’t usually use WYSIWYG. The only occasions when I do use Dreamweaver are when I want to draw something to see what it looks like, and then I’ll usually either take that design and hand-modify it or build it all over again from scratch in code. I have actually written my own desktop HTML IDE for Windows (it’s called Less Than Slash) with the intention of deploying it for use in web development training. If has built-in reference features, and will autocomplete code by parsing the DTD you specify in the file. That is to say, the program doesn’t know anything about HTML until after it parses the HTML DTD you specified. This should give you some idea of my skill level with HTML.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners