Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

51.

What Is Css Rule 'ruleset'?

Answer»

There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector or selectors and declares style which is to be attached to that selector or selectors. For EXAMPLE P {text-indent: 10pt} is a CSS rule. CSS rulesets CONSIST of two PARTS: selector, e.g. P and declaration, e.g. {text-indent: 10pt}.

P {text-indent: 10pt} - CSS rule (ruleset)
{text-indent: 10pt} - CSS declaration
text-indent - CSS PROPERTY
10pt - CSS VALUE

There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector or selectors and declares style which is to be attached to that selector or selectors. For example P {text-indent: 10pt} is a CSS rule. CSS rulesets consist of two parts: selector, e.g. P and declaration, e.g. {text-indent: 10pt}.

P {text-indent: 10pt} - CSS rule (ruleset)
{text-indent: 10pt} - CSS declaration
text-indent - CSS property
10pt - CSS value

52.

Is Css Case Sensitive?

Answer»

CASCADING Style Sheets (CSS) is not case sensitive. However, FONT families, URLs to images, and other direct references with the style sheet may be.

The trick is that if you write a document using an XML declaration and an XHTML doctype, then the CSS class names will be case sensitive for some browsers.

It is a good idea to avoid naming classes where the only difference is the case, for example:

div.myclass { ...}
div.myClass { ... }

If the DOCTYPE or XML declaration is ever REMOVED from your pages, even by mistake, the last instance of the style will be used, regardless of case.

Cascading Style Sheets (CSS) is not case sensitive. However, font families, URLs to images, and other direct references with the style sheet may be.

The trick is that if you write a document using an XML declaration and an XHTML doctype, then the CSS class names will be case sensitive for some browsers.

It is a good idea to avoid naming classes where the only difference is the case, for example:

div.myclass { ...}
div.myClass { ... }

If the DOCTYPE or XML declaration is ever removed from your pages, even by mistake, the last instance of the style will be used, regardless of case.

53.

What Is External Style Sheet? How To Link?

Answer»

External STYLE Sheet is a template/document/file containing style information which can be linked with any number of HTML documents. This is a very convenient way of formatting the entire site as well as restyling it by editing just one file. The file is linked with HTML documents via the LINK element inside the HEAD element. FILES containing style information MUST have extension .CSS, e.g. style.css.

External Style Sheet is a template/document/file containing style information which can be linked with any number of HTML documents. This is a very convenient way of formatting the entire site as well as restyling it by editing just one file. The file is linked with HTML documents via the LINK element inside the HEAD element. Files containing style information must have extension .css, e.g. style.css.

54.

What Are Cascading Style Sheets?

Answer»

A CASCADING Style Sheet (CSS) is a list of statements (also known as rules) that can assign VARIOUS rendering properties to HTML elements. Style rules can be SPECIFIED for a single element occurrence, multiple elements, an entire document, or even multiple documents at once. It is possible to specify many different rules for an element in different locations using different methods. All these rules are collected and merged (known as a "cascading" of STYLES) when the document is rendered to form a single style rule for each element.

A Cascading Style Sheet (CSS) is a list of statements (also known as rules) that can assign various rendering properties to HTML elements. Style rules can be specified for a single element occurrence, multiple elements, an entire document, or even multiple documents at once. It is possible to specify many different rules for an element in different locations using different methods. All these rules are collected and merged (known as a "cascading" of styles) when the document is rendered to form a single style rule for each element.

55.

What Are Style Sheets?

Answer»

STYLE Sheets are templates, very similar to templates in desktop publishing APPLICATIONS, CONTAINING a COLLECTION of rules declared to various selectors (elements).

Style Sheets are templates, very similar to templates in desktop publishing applications, containing a collection of rules declared to various selectors (elements).

56.

How Do I Do Multiple Colors Of Text?

Answer»

To do the MULTICOLOR text adjust the color of your font TAG as:
< font color="BLUE">blue

To do the multicolor text adjust the color of your font tag as:
< font color="blue">blue

57.

How Do I Close A Browser Window With Html Code?

Answer»

Use the below code EXAMPLE. < TYPE="BUTTON" value="Close this window" onclick="self.close()"&GT;

Use the below code example. < type="button" value="Close this window" onclick="self.close()">

58.

How Do I Add Scrolling Text To My Page?

Answer»

ADD a TAG of MARQUEE

Add a Tag of marquee

59.

What Are The Differences Between Cell Spacing And Cell Padding?

Answer»

Cell padding is used for formatting purpose which is used to specify the SPACE NEEDED between the edges of the cells and ALSO in the cell contents. Cell spacing is ONE also used f formatting but there is a major difference between cell padding and cell spacing. It is as follows: Cell padding is used to set EXTRA space which is used to separate cell walls from their contents. But in contrast cell spacing is used to set space between cells.

Cell padding is used for formatting purpose which is used to specify the space needed between the edges of the cells and also in the cell contents. Cell spacing is one also used f formatting but there is a major difference between cell padding and cell spacing. It is as follows: Cell padding is used to set extra space which is used to separate cell walls from their contents. But in contrast cell spacing is used to set space between cells.

60.

What Are Differences Between Div And Span?

Answer»

DIV is used to select a block of text so that one can apply styles to it. SPAN is used to select inline text and let users to apply styles to it. The main difference between DIV and SPAN is SPAN does not do formatting by itself. Also the DIV tag is used as a PARAGRAPH break as it creates a logical division of the document in which it is applied. This is in CONTRAST to the SPAN as SPAN SIMPLY dos the FUNCTIONALITY of applying the style and alignment whatever was specified in it. DIV has ALIGN attribute in it which is not present in case of SPAN. Thus DIV is used in cases where one wants to apply styles to a block of text. But there may be SITUATIONS in which there might not be clear well structured block of text to work with. In those cases one can opt to apply SPAN which is used to apply styles inline. That is in other words DIV is generally used for block of text and SPAN is generally used for words or sentences.

DIV is used to select a block of text so that one can apply styles to it. SPAN is used to select inline text and let users to apply styles to it. The main difference between DIV and SPAN is SPAN does not do formatting by itself. Also the DIV tag is used as a paragraph break as it creates a logical division of the document in which it is applied. This is in contrast to the SPAN as SPAN simply dos the functionality of applying the style and alignment whatever was specified in it. DIV has ALIGN attribute in it which is not present in case of SPAN. Thus DIV is used in cases where one wants to apply styles to a block of text. But there may be situations in which there might not be clear well structured block of text to work with. In those cases one can opt to apply SPAN which is used to apply styles inline. That is in other words DIV is generally used for block of text and SPAN is generally used for words or sentences.

61.

How To Place A Background For A Single Table Cell?

Answer»

You can put a background for a single table CELL in TWO WAYS namely: EITHER by using HTML Using CSS

You can put a background for a single table cell in two ways namely: Either by using HTML Using CSS

62.

What Is Meant By Iframe ?

Answer»

iframe is used for creating an inline or floating frame. As most of know frames are MAINLY used to structure the page or for placing a menu bar on the side and so on. But iframe is used in a different context. That is in other WORDS iframe is used to embed or INSERT content on a page of padding. This is done for several reasons. Say the content may be large enough that the user may wish to PLACE it separately and SCROLL through it.

iframe is used for creating an inline or floating frame. As most of know frames are mainly used to structure the page or for placing a menu bar on the side and so on. But iframe is used in a different context. That is in other words iframe is used to embed or insert content on a page of padding. This is done for several reasons. Say the content may be large enough that the user may wish to place it separately and scroll through it.

63.

What Are The Attributes That Make Up A Dhtml?

Answer»

DHTML is CALLED as Dynamic HTML. This is used to increase the interactive ability and the visual effect of the WEB pages which is loaded in the BROWSER. The MAIN technologies that are used in DHTML are namely:
* HTML
* JavaScript
* CSS which is also called as Cascading Style Sheet
* DOM also called as Document Object Model

DHTML is called as Dynamic HTML. This is used to increase the interactive ability and the visual effect of the web pages which is loaded in the browser. The main technologies that are used in DHTML are namely:
* HTML
* JavaScript
* CSS which is also called as Cascading Style Sheet
* DOM also called as Document Object Model

64.

How Do I Make A Frame With A Vertical Scrollbar But Without A Horizontal Scrollbar?

Answer»

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.

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.

65.

Why Do My Links Open New Windows Rather Than Update An Existing Frame?

Answer»

If there is no existing frame with the name you used for the TARGET attribute, then a new browser window will be opened, and this window will be assigned the name you used. Furthermore, TARGET="_blank" will open a new, unnamed browser window.

In HTML 4, the TARGET attribute value is case-insensitive, so that abc and ABC both refer to the same frame/window, and _top and _TOP both have the same meaning. However, most browsers treat the TARGET attribute value as case-sensitive and do not recognize ABC as being the same as abc, or _TOP as having the special meaning of _top.

Also, some browsers include a security feature that prevents documents from being hijacked by third-party framesets. In these browsers, if a document's LINK targets a frame defined by a frameset document that is located on a different SERVER than the document itself, then the link opens in a new window instead.

If there is no existing frame with the name you used for the TARGET attribute, then a new browser window will be opened, and this window will be assigned the name you used. Furthermore, TARGET="_blank" will open a new, unnamed browser window.

In HTML 4, the TARGET attribute value is case-insensitive, so that abc and ABC both refer to the same frame/window, and _top and _TOP both have the same meaning. However, most browsers treat the TARGET attribute value as case-sensitive and do not recognize ABC as being the same as abc, or _TOP as having the special meaning of _top.

Also, some browsers include a security feature that prevents documents from being hijacked by third-party framesets. In these browsers, if a document's link targets a frame defined by a frameset document that is located on a different server than the document itself, then the link opens in a new window instead.

66.

How Can I Display An Image On My Page?

Answer»

Use an IMG element. The SRC attribute specifies the LOCATION of the image. The ALT attribute provides ALTERNATE text for those not LOADING images. For EXAMPLE:

<img src="logo.gif" alt="ACME Products">

Use an IMG element. The SRC attribute specifies the location of the image. The ALT attribute provides alternate text for those not loading images. For example:

<img src="logo.gif" alt="ACME Products">

67.

Why Does The Browser Show My Plain Html Source?

Answer»

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.

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.

68.

When I Try To Upload My Site, All My Images Are X's. How Do I Get Them To Load Correctly?

Answer»

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&GT; 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.

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.

69.

My Page Looks Good On One Browser, But Not On Another.

Answer»

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.

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.

70.

How Do You Create Tabs Or Indents In Web Pages?

Answer»

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.

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.

71.

The Colors On My Page Look Different When Viewed On A Mac And A Pc.

Answer»

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.

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.

72.

How Do I Keep People From Stealing My Source Code And/or Images?

Answer»

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.

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.

73.

How To Transferring User To New Web Page Automatically?

Answer»

You will need to USE the below meta tag. 
<META HTTP-EQUIV="Refresh" CONTENT="2"; URL="http://www.yourname.com"&GT
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.

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.

74.

Can I Use Any Html In The Box?

Answer»

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.

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.

75.

How Do I Put Sounds For Older Versions Of Internet Explorer?

Answer»

For OLDER versions of INTERNET EXPLORER, this technique was USED &LT;BG SOUND="sound.ext">.

For older versions of Internet Explorer, this technique was used <BG SOUND="sound.ext">.

76.

What Is The Difference Between The Html Form Methods Get And Post?

Answer»

The METHOD PARAMETER specifies which method the CLIENT is using to send INFORMATION to the WEB server. The method determines which parameter you will find the CGI REQUEST data in:
* POST - post_args
* GET - httpargs

The method parameter specifies which method the client is using to send information to the WEB server. The method determines which parameter you will find the CGI request data in:
* POST - post_args
* GET - httpargs

77.

Why Doesn't My Title Show Up When I Click "check It Out"?

Answer»

You're probably looking at the wrong part of the SCREEN. The Title USUALLY shows up in the Title BAR on the Window, to the left of the minimize/maximize buttons on graphical browsers.

You're probably looking at the wrong part of the screen. The Title usually shows up in the Title Bar on the Window, to the left of the minimize/maximize buttons on graphical browsers.

78.

Is It Possible To Make The Html Source Not Viewable?

Answer»

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.

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.

79.

How Can I Copy Something From A Webpage To My Webpage?

Answer»

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 and 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.

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 and 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.

80.

How Can I Specify Background Images?

Answer»

With HTML, you can suggest a BACKGROUND IMAGE with the BACKGROUND attribute of the BODY element. Here is an example: 

<body background="imagefile.gif" bgcolor="#ffffff" text="#000000" LINK="#0000ff" vlink="#800080" alink="#000080"> 

If you specify a background image, you should also specify text, link, and background colors since the reader's default colors may not provide adequate contrast against your background image. The background COLOR may be USED by those not using your background image. Authors should not rely on the specified background image since browsers allow their users to disable image loading or to override document-specified backgrounds.

With HTML, you can suggest a background image with the BACKGROUND attribute of the BODY element. Here is an example: 

<body background="imagefile.gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#000080"> 

If you specify a background image, you should also specify text, link, and background colors since the reader's default colors may not provide adequate contrast against your background image. The background color may be used by those not using your background image. Authors should not rely on the specified background image since browsers allow their users to disable image loading or to override document-specified backgrounds.

81.

Why Aren't My Frames The Exact Size I Specified?

Answer»

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.

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.

82.

How Do I Remove The Border Around Frames?

Answer»

Removing the border around frames involves both not drawing the frame BORDERS and eliminating the space between the frames. The most widely supported way to DISPLAY borderless frames is <FRAMESET ... BORDER=0 FRAMEBORDER=0 FRAMESPACING=0>. 

Note that these attributes are proprietary and not part of the HTML 4.01 specifications. (HTML 4.01 does DEFINE the FRAMEBORDER attribute for the FRAME element, but not for the FRAMESET element.) Also, removing the border around a frame makes it difficult to resize it, as this border is also used in most GUIs to change the size of the frame.

Removing the border around frames involves both not drawing the frame borders and eliminating the space between the frames. The most widely supported way to display borderless frames is <FRAMESET ... BORDER=0 FRAMEBORDER=0 FRAMESPACING=0>. 

Note that these attributes are proprietary and not part of the HTML 4.01 specifications. (HTML 4.01 does define the FRAMEBORDER attribute for the FRAME element, but not for the FRAMESET element.) Also, removing the border around a frame makes it difficult to resize it, as this border is also used in most GUIs to change the size of the frame.

83.

How Do I Specify Page Breaks In Html?

Answer»

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.

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.

84.

How Can I Make A Form With Custom Buttons?

Answer»

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.

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.

85.

How Do I Create A Button Which Acts Like A Link?

Answer»

This is best DONE with a small form:

<FORM ACTION="[URL]" METHOD=GET>
<INPUT TYPE=submit VALUE="TEXT on button">
</FORM>

If you want to line up BUTTONS next to each other, you will have to put them in a one-row table, with each button in a SEPARATE cell. 

This is best done with a small form:

<FORM ACTION="[URL]" METHOD=GET>
<INPUT TYPE=submit VALUE="Text on button">
</FORM>

If you want to line up buttons next to each other, you will have to put them in a one-row table, with each button in a separate cell. 

86.

How Do I Create A Link That Opens A New Window?

Answer»

&LT;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.

<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.

87.

How Do I Create A Link?

Answer»

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 &LT;URL:http://www.htmlhelp.com/faq/html/>: 
<A HREF="http://www.yoursite.com/faq/html/">Web Authoring FAQ</A>

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>

88.

How Do I Specify A Specific Combination Of Frames Instead Of The Default Document?

Answer»

This is UNFORTUNATELY not POSSIBLE. When you navigate through a site using frames, the URL will not CHANGE as the documents in the individual frames change. This means that there is no way to indicate the combination of documents that make up the current state of the frameset.

The author can provide multiple frameset documents, one for each combination of frame content. These frameset documents can be generated automatically, perhaps being created on the fly by a CGI program. Rather than linking to individual content documents, the author can link to these separate frameset documents using TARGET="_top". THUS, the URL of the current frameset document will always specify the combination of frames being displayed, which allows links, bookmarks, etc. to function normally.

This is unfortunately not possible. When you navigate through a site using frames, the URL will not change as the documents in the individual frames change. This means that there is no way to indicate the combination of documents that make up the current state of the frameset.

The author can provide multiple frameset documents, one for each combination of frame content. These frameset documents can be generated automatically, perhaps being created on the fly by a CGI program. Rather than linking to individual content documents, the author can link to these separate frameset documents using TARGET="_top". Thus, the URL of the current frameset document will always specify the combination of frames being displayed, which allows links, bookmarks, etc. to function normally.

89.

How Do I Link An Image To Something?

Answer»

Just use the image as the LINK content, LIKE this:

<a HREF=...><img src=... ALT=...></a>

Just use the image as the link content, like this:

<a href=...><img src=... alt=...></a>

90.

How Do I Change The Title Of A Framed Document?

Answer»

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).

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).

91.

How Can I Require That Fields Be Filled In, Or Filled In Correctly?

Answer»

Have the server-side (e.g., CGI) program that processes the form submission send an error message if the field is not filled in properly. Ideally, this error message should include a copy of the original form with the original (INCOMPLETE or incorrect) DATA filled in as the default VALUES for the form fields. The Perl CGI.pm module provides HELPFUL mechanisms for returning partially completed forms to the user.

In addition, you could use JavaScript in the form's ONSUBMIT attribute to check the form data. If JavaScript support is enabled, then the ONSUBMIT event handler can inform the user of the problem and return false to PREVENT the form from being submitted.

Have the server-side (e.g., CGI) program that processes the form submission send an error message if the field is not filled in properly. Ideally, this error message should include a copy of the original form with the original (incomplete or incorrect) data filled in as the default values for the form fields. The Perl CGI.pm module provides helpful mechanisms for returning partially completed forms to the user.

In addition, you could use JavaScript in the form's ONSUBMIT attribute to check the form data. If JavaScript support is enabled, then the ONSUBMIT event handler can inform the user of the problem and return false to prevent the form from being submitted.

92.

How Can I Allow File Uploads To My Web Site?

Answer»

These things are necessary for Web-based uploads:

* An HTTP SERVER that accepts uploads.
* Access to the /cgi-bin/ to put the receiving script. Prewritten CGI file-upload scripts are available.
* A form implemented something LIKE this:

<form method="POST" enctype="multipart/form-data" ACTION="fup.cgi">
File to upload: <input type=file name=upfile><br>
Notes about the file: <input type=text name=note><br>
<input type=submit value=Press> to upload the file!
</form>

Not all browsers support form-based file upload, so try to give alternatives where possible.
The Perl CGI.pm module supports file upload. The most recent VERSIONS of the cgi-lib.pl library also support file upload. Also, if you need to do file upload in conjunction with form-to-email, the Perl package MIME::Lite handles email attachments.

These things are necessary for Web-based uploads:

* An HTTP server that accepts uploads.
* Access to the /cgi-bin/ to put the receiving script. Prewritten CGI file-upload scripts are available.
* A form implemented something like this:

<form method="post" enctype="multipart/form-data" action="fup.cgi">
File to upload: <input type=file name=upfile><br>
Notes about the file: <input type=text name=note><br>
<input type=submit value=Press> to upload the file!
</form>

Not all browsers support form-based file upload, so try to give alternatives where possible.
The Perl CGI.pm module supports file upload. The most recent versions of the cgi-lib.pl library also support file upload. Also, if you need to do file upload in conjunction with form-to-email, the Perl package MIME::Lite handles email attachments.

93.

How Can I Specify Colors?

Answer»

If you want others to view your web page with SPECIFIC colors, the most appropriate way is to suggest the colors with a style SHEET. Cascading Style Sheets use the color and background-color PROPERTIES to specify text and background colors. To avoid conflicts between the reader's default colors and those suggested by the author, these two properties should always be used together. 

With HTML, you can suggest colors with the TEXT, LINK, VLINK (visited link), ALINK (active link), and BGCOLOR (background color) attributes of the BODY element. 

Note that these attributes are deprecated by HTML 4. ALSO, if one of these attributes is used, then all of them should be used to ensure that the reader's default colors do not interfere with those suggested by the author. Here is an example: 

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#000080"> 
Authors should not rely on the specified colors since browsers allow their users to override document-specified colors.

If you want others to view your web page with specific colors, the most appropriate way is to suggest the colors with a style sheet. Cascading Style Sheets use the color and background-color properties to specify text and background colors. To avoid conflicts between the reader's default colors and those suggested by the author, these two properties should always be used together. 

With HTML, you can suggest colors with the TEXT, LINK, VLINK (visited link), ALINK (active link), and BGCOLOR (background color) attributes of the BODY element. 

Note that these attributes are deprecated by HTML 4. Also, if one of these attributes is used, then all of them should be used to ensure that the reader's default colors do not interfere with those suggested by the author. Here is an example: 

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#000080"> 
Authors should not rely on the specified colors since browsers allow their users to override document-specified colors.

94.

How Do I Eliminate The Blue Border Around Linked Images?

Answer»

In your HTML, you can specify the BORDER attribute for the image: 
<a HREF=...&GT;<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.

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.

95.

How Can I Show Html Examples Without Them Being Interpreted As Part Of My Document?

Answer»

Within the HTML example, first REPLACE the "&" character with "&amp;" everywhere it occurs. Then replace the "&LT;" character with "<" and the "&GT;" character with ">" in the same way. 

Note that it may be appropriate to use the CODE and/or PRE elements when displaying HTML examples.

Within the HTML example, first replace the "&" character with "&amp;" everywhere it occurs. Then replace the "&lt;" character with "<" and the "&gt;" character with ">" in the same way. 

Note that it may be appropriate to use the CODE and/or PRE elements when displaying HTML examples.

96.

How Can I Eliminate The Extra Space After A Tag?

Answer»

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=...&GT;

You can also use a CSS style sheet to AFFECT all the FORMS on a page:
form { margin-bottom: 0 ; }

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 ; }

97.

How Do I Set The Focus To The First Form Field?

Answer»

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: 

&LT;form id="myform" name="myform" action=...&GT;
<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.

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.

98.

How Do I Make A Form So It Can Be Submitted By Hitting Enter?

Answer»

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.

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.

99.

Do I Have To Memorize A Bunch Of Tags?

Answer»

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.

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.

100.

How Can I Check For Errors?

Answer»

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.

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.