How Can I Check For Errors?
HTML validators check HTML documents against a formal definition of HTML syntax and then output a list of errors. Validation is important to give the best chance of correctness on unknown browsers (both existing browsers that you haven't seen and future browsers that haven't been written yet).
HTML checkers (linters) are also useful. These programs check documents for specific problems, including some caused by invalid markup and others caused by common browser bugs. Checkers may pass some invalid documents, and they may fail some valid ones.
All validators are functionally equivalent; while their reporting styles may vary, they will find the same errors given identical input. Different checkers are programmed to look for different problems, so their reports will vary significantly from each other. Also, some programs that are called validators (e.g. the "CSE HTML Validator") are really linters/checkers. They are still useful, but they should not be confused with real HTML validators.
When checking a site for errors for the first time, it is often useful to identify common problems that occur repeatedly in your markup. Fix these problems everywhere they occur (with an automated process if possible), and then go back to identify and fix the remaining problems.
Link checkers follow all the links on a site and report which ones are no longer functioning. CSS checkers report problems with CSS style sheets.
Do I Have To Memorize A Bunch Of Tags?
No. Most programs that help you write HTML code already know most tags, and create them when you press a button. But you should understand what a tag is, and how it works. That way you can correct errors in your page more easily.
How Do I Make A Form So It Can Be Submitted By Hitting Enter?
The short 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.
How Do I Set The Focus To The First Form Field?
You cannot do this with HTML. However, you can include a script after the form that sets the focus to the appropriate field, like this
<form id="myform" name="myform" action=...>
<input type="text" id="myinput" name="myinput" ...>
</form>
<script type="text/javascript">
document.myform.myinput.focus();
</script>
A similar approach uses <body onload=...> to set the focus, but some browsers seem to process the ONLOAD event before the entire document (i.e., the part with the form) has been loaded.
How Can I Eliminate The Extra Space After A Tag?
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 ; }
How Can I Show Html Examples Without Them Being Interpreted As Part Of My Document?
Within the HTML example, first replace the "&" character with "&" everywhere it occurs. Then replace the "<" character with "<" and the ">" character with ">" in the same way.
Note that it may be appropriate to use the CODE and/or PRE elements when displaying HTML examples.
How Do I Eliminate The Blue Border Around Linked Images?
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.
How Do I Change The Title Of A Framed Document?
The title displayed is the title of the frameset document rather than the titles of any of the pages within frames. To change the title displayed, link to a new frameset document using TARGET="_top" (replacing the entire frameset).
How Can I Make A Form With Custom Buttons?
Rather than a normal submit button (<input type="submit" ...>), you can use the image input type (<input type="image" ...>). The image input type specifies a graphical submit button that functions like a server-side image map.
Unlike normal submit buttons (which return a name=value pair), the image input type returns the x-y coordinates of the location where the user clicked on the image. The browser returns the x-y coordinates as name.x=000 and name.y=000 pairs.
ronments, the VALUE and ALT attributes should be set to the same value as the NAME attribute. For example
<input type="image" name="Send" alt="Send" value="Send" src="send-button.gif">
For the reset button, one could use <button type="reset" ...>, JavaScript, and/or style sheets, although none of these mechanisms work universally.
How Do I Specify Page Breaks In Html?
There is no way in standard HTML to specify where page breaks will occur when printing a page. HTML was designed to be a device-independent structural definition language, and page breaks depend on things like the fonts and paper size that the person viewing the page is using.
HTML validators check HTML documents against a formal definition of HTML syntax and then output a list of errors. Validation is important to give the best chance of correctness on unknown browsers (both existing browsers that you haven't seen and future browsers that haven't been written yet).
HTML checkers (linters) are also useful. These programs check documents for specific problems, including some caused by invalid markup and others caused by common browser bugs. Checkers may pass some invalid documents, and they may fail some valid ones.
All validators are functionally equivalent; while their reporting styles may vary, they will find the same errors given identical input. Different checkers are programmed to look for different problems, so their reports will vary significantly from each other. Also, some programs that are called validators (e.g. the "CSE HTML Validator") are really linters/checkers. They are still useful, but they should not be confused with real HTML validators.
When checking a site for errors for the first time, it is often useful to identify common problems that occur repeatedly in your markup. Fix these problems everywhere they occur (with an automated process if possible), and then go back to identify and fix the remaining problems.
Link checkers follow all the links on a site and report which ones are no longer functioning. CSS checkers report problems with CSS style sheets.
Do I Have To Memorize A Bunch Of Tags?
No. Most programs that help you write HTML code already know most tags, and create them when you press a button. But you should understand what a tag is, and how it works. That way you can correct errors in your page more easily.
How Do I Make A Form So It Can Be Submitted By Hitting Enter?
The short 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.
WNS Global Most Frequently Asked Latest HTML Interview Questions Answers |
How Do I Set The Focus To The First Form Field?
You cannot do this with HTML. However, you can include a script after the form that sets the focus to the appropriate field, like this
<form id="myform" name="myform" action=...>
<input type="text" id="myinput" name="myinput" ...>
</form>
<script type="text/javascript">
document.myform.myinput.focus();
</script>
A similar approach uses <body onload=...> to set the focus, but some browsers seem to process the ONLOAD event before the entire document (i.e., the part with the form) has been loaded.
How Can I Eliminate The Extra Space After A Tag?
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 ; }
How Can I Show Html Examples Without Them Being Interpreted As Part Of My Document?
Within the HTML example, first replace the "&" character with "&" everywhere it occurs. Then replace the "<" character with "<" and the ">" character with ">" in the same way.
Note that it may be appropriate to use the CODE and/or PRE elements when displaying HTML examples.
How Do I Eliminate The Blue Border Around Linked Images?
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.
How Do I Change The Title Of A Framed Document?
The title displayed is the title of the frameset document rather than the titles of any of the pages within frames. To change the title displayed, link to a new frameset document using TARGET="_top" (replacing the entire frameset).
How Can I Make A Form With Custom Buttons?
Rather than a normal submit button (<input type="submit" ...>), you can use the image input type (<input type="image" ...>). The image input type specifies a graphical submit button that functions like a server-side image map.
Unlike normal submit buttons (which return a name=value pair), the image input type returns the x-y coordinates of the location where the user clicked on the image. The browser returns the x-y coordinates as name.x=000 and name.y=000 pairs.
ronments, the VALUE and ALT attributes should be set to the same value as the NAME attribute. For example
<input type="image" name="Send" alt="Send" value="Send" src="send-button.gif">
For the reset button, one could use <button type="reset" ...>, JavaScript, and/or style sheets, although none of these mechanisms work universally.
How Do I Specify Page Breaks In Html?
There is no way in standard HTML to specify where page breaks will occur when printing a page. HTML was designed to be a device-independent structural definition language, and page breaks depend on things like the fonts and paper size that the person viewing the page is using.
Post a Comment