html and dhtml questions

23
HTML and DHTML Questions; 1. Submit alert <form> <input type="button" onclick="alert('Are you sure you want to give us the deed to your house?')" value="Confirmation Alert"></form> 2. Javascript Confirm Example; <html> <head> <script type="text/javascript"> <!-- function confirmation() { var answer = confirm("Leave tizag.com?") if (answer){ alert("Bye bye!") window.location = "http://www.google.com/"; } else{ alert("Thanks for sticking around!") } } //--> </script> </head> <body> <form> <input type="button" onclick="confirmation()" value="Leave Tizag.com"> </form> </body> </html> 3. Time Delay Redirect? <html> <head> <script type="text/javascript"> <!-- function delayer(){ window.location = "../javascriptredirect.php" } //--> </script> </head> <body onLoad="setTimeout('delayer()', 5000)"> <h2 >Prepare to be redirected!</h2> <p>This page is a time delay redirect, please update your bookmarks to our new location!</p> </body> </html> 4. What is shtml? A. secure html is shtml (serverside(ssl) 5. How will you attach css style in html? A. <link href=”style.css” rel=”stylesheet” type=”text/css”> 6. What is Dhtml? A. if any website using html, JavaScript&CSS that is Dhtml. 7. How do I center a table? A. <P ALIGN=left> or <DIV ALIGN=left>

Upload: anand-rubens-ch

Post on 08-Apr-2015

256 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: HTML and DHTML Questions

HTML and DHTML Questions; 1. Submit alert <form> <input type="button" onclick="alert('Are you sure you want to give us the deed to your house?')" value="Confirmation Alert"></form> 2. Javascript Confirm Example; <html> <head> <script type="text/javascript"> <!-- function confirmation() { var answer = confirm("Leave tizag.com?") if (answer){ alert("Bye bye!") window.location = "http://www.google.com/"; } else{ alert("Thanks for sticking around!") } } //--> </script> </head> <body> <form> <input type="button" onclick="confirmation()" value="Leave Tizag.com"> </form> </body> </html> 3. Time Delay Redirect? <html> <head> <script type="text/javascript"> <!-- function delayer(){ window.location = "../javascriptredirect.php" } //--> </script> </head> <body onLoad="setTimeout('delayer()', 5000)"> <h2 >Prepare to be redirected!</h2> <p>This page is a time delay redirect, please update your bookmarks to our new location!</p> </body> </html> 4. What is shtml? A. secure html is shtml (serverside(ssl) 5. How will you attach css style in html? A. <link href=”style.css” rel=”stylesheet” type=”text/css”> 6. What is Dhtml? A. if any website using html, JavaScript&CSS that is Dhtml. 7. How do I center a table? A. <P ALIGN=left> or <DIV ALIGN=left>

Page 2: HTML and DHTML Questions

8. How do I use an image instead of the standard submit button? A. <INPUT NAME=foo TYPE=image SRC="http://url.to/image.gif"> 9. How can you have different number of cells for each row of a table? A. By using the COLSPAN attribute of the <TD> tag. Example: <TABLE> <TR> <TD>Column 1</TD> <TD>Comumn 2</TD> </TR> <TR> <TD COLSPAN = "2">Column1 & Column 2</TD> </TR> </TABLE> 10. What are the two tags for framesets? A. Frameset cols & frame set Rows <FRAMESET cols="33%,33%,33%"> <FRAMESET rows="*,200"> <FRAME src="contents_of_frame1.html"> <FRAME src="contents_of_frame2.gif"> </FRAMESET> <FRAME src="contents_of_frame3.html"> 11. How do I get a button which takes me to a new page? A. Form action “pagename” method “get”: <FORM ACTION="http://url.you.want.to.go.to/" METHOD=GET> <INPUT TYPE=submit VALUE="Text on button" NAME=foo> </FORM> 12. Is there a way to get indexed better by the search engines? A. Mention Meta tag inside of head tag. <META NAME="keywords" CONTENT="keyword keyword keyword keyword"> <META NAME="description" CONTENT="description of your site"> 13. What is HTML (Hypertext Markup Language)? A. It’s a method by which web pages can be built and generally used For formatting and linking text. 14. HOW MUCH OF LANGUAGES ARE USEFULL FOR WEB DESIGNING. A. HTML, DHTML, JAVASCRIPT, XML, VB SCRIPT. 15. What are META tags? A. An HTML tag that provides information about a Web page, such as its title, description, and subject keywords. Unlike other tags, Meta tags do not affect how the page is displayed. (Search engine) 16. What are the three tags of a form tag in HTML form? A. A <form> tag has three attributes: 1. Method 2. Action 3. Enctype 17. How do you create Drop down Combos in HTML? A. Using option selects coding <select name="age"> <Option>selects </option> 18. How do I use an image instead of the standard submit button? A. <INPUT NAME=foo TYPE=image RC="http://url.to/image.gif">

Page 3: HTML and DHTML Questions

19. How to download Flash object embeded in HTML Page? A. There are two ways to download the (.swf) file, 1. First we want to know the file name of .swf, we can get it by Right click the mouse View Source and Enter the key word .swf in find option. We can get the file name. Now, we can take this file from Temporary Internet Files folder in our system. While we visit or browse a site all file are stored in Temporary Internet Files, from this folder we can take all the files. 2. Second method is by using some swf catcher (like Sothink Swf Catcher) software’s we can download the file. By using these methods only ill download the Flash object. 20. What is the difference between the CLASS and ID when you are writting CSS? A. ID: In CSS we can call id with '#' and can be used only one time For one page. Class: When coming to the case of class in CSS it can Be used infinite number of times in the same page as well as In the whole site. 21. What is HTML (Hypertext Markup Language)? A. It’s a method by which web pages can be built and generally used for formatting and linking text. 22. How do I get a so-and-so character in my HTML? A. HTML text is supposed to be written in the ISO Latin-1 character set. A complete overview of all the characters in this set is available from: http://www.w3.org/pub/WWW/MarkUp/html3/latin1.html 23. How do I get a back button on my page? A. In HTML, this is impossible. Going "back" means that you go to the previous page in your history. You might be able to create a link to the URL specified in the "HTTP_REFERER" environment variable in your document, but that only creates a link to a new location in your history. Even worse, the information in that variable can be plain wrong. Some browsers incorrectly send the variable when you use a bookmark or type in an URL manually, and some don't send that variable at all. Then you would end up with an empty link. A JavaScript could use "history.back()" to do this, but this only works in Netscape 2. 24. How do I do a pagebreak? A.You don't. HTML is not a page layout language. It's up to the browser to decide where and how to insert page breaks when the document is being printed. However, style sheets (not widely supported yet, although Microsoft's Internet Explorer is beginning to use it) will include support to indicate preferred balls for page breaks, probably somewhat like the way LaTeX handles this. 25. For what screen size should I write? A. HTML does not depend on screen size. The text will be wrapped by the browser when the end of the screen is encountered. The only exception to this is when you use <PRE>-formatted text, which will only wrap at the line breaks you indicate. So make sure these lines are no longer than 70 characters, otherwise text mode users will see ugly line breaks on their terminals. And users of graphical browsers might have to scroll horizontally to see the rest, which is one of the most hated things to do when you read a document. Of course, an image cannot be wrapped, so you have to be careful with that. It seems that 400 or 500 pixels is a reasonable width; anything above 600 will mean a certain percentage of users will have to scroll to see the rightmost bit. This percentage increases with your image width. Keep in mind that not everyone runs his browser at full screen! 26.How can I make a custom rule, or a list with custom bullets? A. Useing <ul> and <Li> you wil get bullets

Page 4: HTML and DHTML Questions

27.How do I indent a lot of text? A.Again, there is no reliable way to do this. Netscape will indent text inside a <BLOCKQUOTE>, but other browsers don't have to do this. These could show the text in italics, or perhaps with quotation marks around the text. This could come out very strange. An alternative is to use <DL> without <DT> and <DD>, which is invalid HTML, but several browsers work around this error by indenting the text inside it. This is not guaranteed to work. If you are willing to use tables for layout purposes, there is another option. Create a one-cell table, as follows: <CENTER> <TABLE width="805px"> <TR><TD><DIV align=left> <!-- The text goes here --> </DIV> </TD></TR> </TABLE> </CENTER> A drawback to this solution is that very long blocks inside a table may take a while to download and may not appear until the entire table has been downloaded. Another drawback is that it may force users to resize their viewing window after they have become accustomed to their preferred settings. 28. HOW MUCH OF LANGUAGES ARE USEFULL FOR WEB DESIGNING ? A. HTML,DHTML,JAVASCRIPT,XML,VB SCRIPT. 29. Diffrence between HTML & DHTML A. DHTML: Dynamic HTML. An extension of HTML that enables, among other things, the inclusion of small animations and dynamic menus in Web pages. DHTML code makes use of style sheets and JavaScript. 30. What is CSS? A. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. Every element type as well as every occurance of a specific element within that type can be declared an unique style, e.g. margins, positioning, color or size. 31. What are Style Sheets? A. Style Sheets are templates, very similar to templates in desktop publishing applications, containing a collection of rules declared to various selectors (elements). 32. What is external Style Sheet? How to link? A. 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. <HEAD> <LINK REL=STYLESHEET HREF="style.css" TYPE="text/css"> </HEAD> 33. What is embedded style? How to link? A. Embedded style is the style attached to one specific document. The style information is specified as a content of the STYLE element inside the HEAD element and will apply to the entire document. <HEAD> <STYLE TYPE="text/css"> <!-- P {text-indent: 10pt} --> </STYLE> </HEAD> Note: The styling rules are written as a HTML comment, that is, between <!-- and --> to hide the content in browsers without CSS support which would otherwise be displayed.

Page 5: HTML and DHTML Questions

34. What is inline style? How to link? A. Inline style is the style attached to one specific element. The style is specified directly in the start tag as a value of the STYLE attribute and will apply exclusively to this specific element occurance. <P STYLE="text-indent: 10pt">Indented paragraph</P> 35. What is imported Style Sheet? How to link? A. Imported Style Sheet is a sheet that can be imported to (combined with) another sheet. This allows creating one main sheet containing declarations that apply to the whole site and partial sheets containing declarations that apply to specific elements (or documents) that may require additional styling. By importing partial sheets to the main sheet a number of sources can be combined into one. To import a style sheet or style sheets include the @import notation or notations in the STYLE element. The @import notations must come before any other declaration. If more than one sheet is imported they will cascade in order they are imported - the last imported sheet will override the next last; the next last will override the second last, and so on. If the imported style is in conflict with the rules declared in the main sheet then it will be overridden. <LINK REL=STYLESHEET HREF="main.css" TYPE="text/css"> <STYLE TYPE="text=css"> <!-- @import url(http://www.and.so.on.partial1.css); @import url(http://www.and.so.on.partial2.css); .... other statements --> </STYLE> 36. What is alternate Style Sheet? How to link? A. Alternate Style Sheet is a sheet defining an alternate style to be used in place of style(s) declared as persistent and/or preferred . Persistent style is a default style that applies when style sheets are enabled but can disabled in favor of an alternate style, e.g.: <LINK REL=Stylesheet HREF="style.css" TYPE="text/css"> Preferred style is a default style that applies automatically and is declared by setting the TITLE attribute to the LINK element. There can only be one preferred style, e.g.: <LINK REL=Stylesheet HREF="style2.css" TYPE="text/css" TITLE="appropriate style description"> Alternate style gives an user the choice of selecting an alternative style - a very convenient way of specifying a media dependent style. Note: Each group of alternate styles must have unique TITLE, e.g.:<LINK REL="Alternate Stylesheet" HREF="style3.css" TYPE="text/css" TITLE="appropriate style description" MEDIA=screen><LINK REL="Alternate Stylesheet" HREF="style4.css" TYPE="text/css" TITLE="appropriate style description" MEDIA=print> 37. What is persistent style? A. Se Alternate style 38. What is preferred style? A. Se Alternate style 39. How do I combine multiple sheets into one? A. To combine multiple/partial style sheets into one set the TITLE attribute taking one and the same value to the LINK element. The combined style will apply as a preferred style, e.g.: <LINK REL=Stylesheet HREF="default.css" TITLE="combined"> <LINK REL=Stylesheet HREF="fonts.css" TITLE="combined"> <LINK REL=Stylesheet HREF="tables.css" TITLE="combined"> 40. What is CSS rule 'ruleset'? A.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

Page 6: HTML and DHTML Questions

41.What is CSS rule 'at-rule'? A.There are two types of CSS rules: ruleset and at-rule. At-rule is a rule that applies to the whole style sheet and not to a specific selector only (like in ruleset). They all begin with the @ symbol followed by a keyword made up of letters a-z, A-Z, digits 0-9, dashes and escaped characters, e.g. @import or @font-face. 42.What is selector? A. CSS selector is equivalent of HTML element(s). It is a string identifying to which element(s) the corresponding declaration(s) will apply and as such the link between the HTML document and the style sheet. For example in P {text-indent: 10pt} the selector is P and is called type selector as it matches all instances of this element type in the document. in P, UL {text-indent: 10pt} the selector is P and UL (see grouping); in .class {text-indent: 10pt} the selector is .class (see class selector). 43. What is CLASS selector? A. Class selector is a "stand alone" class to which a specific style is declared. Using the CLASS attribute the declared style can then be associated with any HTML element. The class selectors are created by a period followed by the class's name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit. (Note: in HTML the value of the CLASS attribute can contain more characters). It is a good practice to name classes according to their function than their appearance. .footnote {font: 70%} /* class as selector */ <ADDRESS CLASS=footnote/>This element is associated with the CLASS footnote</ADDRESS> <P CLASS=footnote>And so is this</P> Table of Contents 44. What is ID selector? A. ID selector is an individually identified (named) selector to which a specific style is declared. Using the ID attribute the declared style can then be associated with one and only one HTML element per document as to differentiate it from all other elements. ID selectors are created by a character # followed by the selector's name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit. #abc123 {color: red; background: black} <P ID=abc123>This and only this element can be identified as abc123</P> 45. What is contextual selector? A. Contextual selector is a selector that addresses specific occurrence of an element. It is a string of individual selectors separated by white space, a search pattern, where only the last element in the pattern is addressed providing it matches the specified context. TD P CODE {color: red} The element CODE will be displayed in red but only if it occurs in the context of the element P which must occur in the context of the element TD. TD P CODE, H1 EM {color: red} The element CODE will be displayed in red as described above AND the element EM will also be red but only if it occurs in the context of H1 P .footnote {color: red} Any element with CLASS footnote will be red but only if it occurs in the context of P P .footnote [lang]{color: red} Any element with attribute LANG will be red but only if it is classed as "footnote" and occurs in the context of P

Page 7: HTML and DHTML Questions

46. What is attribute selector? [CSS2] A. Attribute selector is a selector defined by 1) the attribute set to element(s), 2) the attribute and value(s), 3) the attribute and value parts: 1a) A[title] {text-decoration: underline} All A elements containing the TITLE attribute will be underlined 1b) A[class=name] {text-decoration: underline} The A elements classed as 'name' will be underlined 2) A[title="attribute element"] {text-decoration: underline} The A elements containing the TITLE attribute with a value that is an exact match of the specified value, which in this example is 'attribute element', will be underlined 3) A[title~="attribute"] {text-decoration: underline} The A elements containing the TITLE attribute with a value containing the specified word, which in this example is 'attribute', will be underlined 47. What is parent-child selector? [CSS2] A. Parent-child selector is a selector representing the direct descendent of a parent element. Parent-child selectors are created by listing two or more tilde (~) separated selectors. BODY ~ P {background: red; color: white} The P element will be declared the specified style only if it directly descends from the BODY element: <BODY><P>Red and white paragraph </P></BODY> BODY ~ P ~ EM {background: red; color: white} The EM element will be declared the specified style only if it directly descends from the P element which in its turn directly descends from the BODY element: <BODY><P><EM>Red and white EM</EM></P></BODY> 48. What is CSS declaration? A. CSS declaration is style attached to a specific selector. It consists of two parts; property which is equivalent of HTML attribute, e.g. text-indent: and value which is equivalent of HTML value, e.g. 10pt. NOTE: properties are always ended with a colon. 49. What is 'important' declaration? A. Important declaration is a declaration with increased weight. Declaration with increased weight will override declarations with normal weight. If both reader's and author's style sheet contain statements with important declarations the author's declaration will override the reader's. BODY {background: white ! important; color: black} In the example above the background property has increased weight while the color property has normal. 49. What is property? A. Property is a stylistic parameter (attribute) that can be influenced through CSS, e.g. FONT or WIDTH. There must always be a corresponing value or values set to each property, e.g. font: bold or font: bold san-serif. 50. What is shorthand property? A. Shorthand property is a property made up of individual properties that have a common "addressee". For example properties: font-weight, font-style, font-variant, font-size, font-family, refer to the font. To reduce the size of style sheets and also save some keystrokes as well as bandwidth they can all be specified as one shorthand property font, e.g.: H1 {font-weight: bold; font-style: italic; font-variant: small-caps; font-size: 160%; font-family: serif} can be all shorthanded to a space separated list: H1 {font: bold italic small-caps 160% serif} Note: To make things even simpler the line-height property can be specified together with the font-size property: H1 {font: bold italic small-caps 160%/170% serif}

Page 8: HTML and DHTML Questions

51. What is value? A. Value is a 'physical' characteristic of the property. Property declares what should be formatted, e.g. FONT while value suggests how the property should be formatted, e.g. 12pt. By setting the value 12pt to the property FONT it is suggested that the formatted text be displayed in a 12 point font. There must always be a corresponding property to each value or set of values. H1 {font: bold 180%} In the example above the H1 selector is declared the FONT property which in its turn is declared the values BOLD and 180%. The values suggesting alternatives are specified in a comma separated list, e.g. H1 {font-family: font1, font2} 52. What is initial value? A. Initial value is a default value of the property that is the value given to the root element of the document tree. All properties have an initial value. If no specific value is set and/or if a property is not inherited the initial value is used. For example the background property is not inherited; however, the background of the parent element shines through because the initial value of background property is transparent. <P style="background: red">Hello <strong>World</strong></P> Content of the element P will also have red background 53. Can I attach more than one declaration to a selector? A. Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list, e.g.; Selector {declaration1; declaration2} P {background: white; color: black} 54. What is class? A. Class is a group of 1) instances of the same element to which an unique style can be attached or 2) instances of different elements to which the same style can be attached. 1) The rule P {color: red} will display red text in all paragraphs. By classifying the selector P different style can be attached to each class allowing the display of some paragraphs in one style and some other paragraphs in another style. 2) A class can also be specified without associating a specific element to it and then attached to any element which is to be styled in accordance with it's declaration. All elements to which a specific class is attached will have the same style. To classify an element add a period to the selector followed by an unique name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit. (Note: in HTML the value of the CLASS attribute can contain more characters). (Note: text between /* and */ are my comments). CSS P.name1 {color: red} /* one class of P selector */ P.name2 {color: blue} /* another class of P selector */ .name3 {color: green} /* can be attached to any element */ HTML <P class=name1>This paragraph will be red</P> <P class=name2>This paragraph will be blue</P> <P class=name3>This paragraph will be green</P> <LI class=name3>This list item will be green</LI> It is a good practice to name classes according to their function than their appearance; e.g. P.fotnote and not P.green. In CSS1 only one class can be attached to a selector. CSS2 allows attaching more classes, e.g.: P.name1.name2.name3 {declaration} <P class="name1 name2 name2">This paragraph has three classes attached</P>

Page 9: HTML and DHTML Questions

55. What is grouping? A. Grouping is gathering (1) into a comma separated list two or more selectors that share the same style or (2) into a semicolon separated list two or more declarations that are attached to the same selector (2). 1. The selectors LI, P with class name .first and class .footnote share the same style, e.g.: LI {font-style: italic} P.first {font-style: italic} .footnote {font-style: italic} To reduce the size of style sheets and also save some typing time they can all be grouped in one list. LI, P.first, .footnote {font-style: italic} 2. The declarations {font-style: italic} and {color: red} can be attached to one selector, e.g.: H2 {font-style: italic} H2 {color: red} And can also be grouped into one list: H2 {font-style: italic; color: red} 56. What are pseudo-elements? A. Pseudo-elements are fictional elements that do not exist in HTML. They address the element's sub-part (non-existent in HTML) and not the element itself. In CSS1 there are two pseudo-elements: 'first-line pseudo-element' and 'first-letter pseudo-element'. They can be attached to block-level elements (e.g. paragraphs or headings) to allow typographical styling of their sub-parts. Pseudo-element is created by a colon followed by pseudo-element's name, e.g: P:first-line H1:first-letter and can be combined with normal classes; e.g: P.initial:first-line First-line pseudo-element allows sub-parting the element's first line and attaching specific style exclusively to this sub-part; e.g.: P.initial:first-line {text-transform: uppercase} <P class=initial>The first line of this paragraph will be displayed in uppercase letters</P> First-letter pseudo-element allows sub-parting the element's first letter and attaching specific style exclusively to this sub-part; e.g.: P.initial:first-letter { font-size: 200%; color: red} <P class=initial>The first letter of this paragraph will be displayed in red and twice as large as the remaining letters</P> 57. What are pseudo-classes? A. Pseudo-classes are fictional element types that do not exist in HTML. In CSS1 there is only one element type which can be classed this way, namely the A element (anchor). By creating three fictional types of the A element individual style can be attached to each class. These three fictional element types are: A as unvisited link, A as active link and A as visited link. Pseudo-classes are created by a colon followed by pseudo-class's name. They can also be combined with normal classes, e.g.: A:link {background: black; color: white} A:active {background: black; color: red} A:visited {background: transparent; color: black} <A HREF....>This anchor (or rather these anchors) will be displayed as declared above</A> A.foot:link {background: black; color: white} A.foft:active {background; black: color: red} A.foot:visited {background: transparent; color: black} <A CLASS=foot HREF....>This anchor and all other anchors with CLASS foot will be displayed as declared above</A>

Page 10: HTML and DHTML Questions

58. What is cascade? A. Cascade is a method of defining the weight (importance) of individual styling rules thus allowing conflicting rules to be sorted out should such rules apply to the same selector. Declarations with increased weight take precedence over declaration with normal weight: P {color: white ! important} /* increased weight */ P (color: black} /* normal weight */ 59. What is cascading order? A. Cascading order is a sorting system consisting of rules by which declarations are sorted out so that there are not conflicts as to which declaration is to influence the presentation. The sorting begins with rule no 1. If a match is found the search is over. If there is no match under rule no 1 the search continues under rule no 2 and so on. 1. Find all declarations that apply to a specific selector/property And Declare the specified style if the selector matches the element if there isn't any Let the element inherit its parent property if there isn't any Use initial value 2. Sort by weight (! important) Increased weight take precedence over normal weight 3.Sort by origin Rules with normal weight declared in author's style sheet will override rules with normal weight declared in user's personal style sheets Rules with increased weight declared in user's personal style sheet will override rules with normal weight declared in author's style sheet Rules with increased weight declared in author's style sheet will override rules with increased weight declared in user's personal style sheets Author's and user's rules will override UA's default style sheet. 4. Sort by selector's specificity More specific selector will override less specific one: ID-selector (most specific), followed by Classified contextual selectors (TABLE P EM.fot) Class selectors (EM.fot) Contextual selectors - the "lower down" the more weight, (TABLE P EM), (TABLE P EM STRONG) - STRONG has more weight than EM. 5. Sort by order specified If two rules have the same weight, the latter specified overrides ones specified earlier. Style sheets are sorted out as follows: The STYLE attribute (inline style) overrides all other styles The Style element (embedded style) overrides linked and imported sheets The LINK element (external style) overrides imported style The @import statement - imported style sheets also cascade with each other in the same order as they are imported 60. What are inline, block, parent, children, replaced and floating elements? A. Inline elements which do not have line breaks. Can occur in block elements or other inline elements, cannot contain block elements. Inline elements in HTML 3.2; EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, TT, I, B, U, STRIKE, BIG, SMALL, SUB, SUP, A, IMG, APPLET, FONT, BASEFONT, BR, SCRIPT, MAP, INPUT, SELECT, TEXTAREA. Inline elements in HTML 4.0; EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM, TT, I, B, BIG, SMALL, SUB, SUP, A, IMG, OBJECT, BR, SCRIPT, MAP, Q, SPAN, BDO, INPUT, SELECT, TEXTAREA, LABEL, BUTTON, (INS, DEL). Inline elements in HTML 4.0 Transitional; EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM, TT, I, B, U, S, STRIKE, BIG, SMALL, SUB, SUP, A, IMG, APPLET, OBJECT, FONT, BASEFONT, BR, SCRIPT, MAP, Q, SPAN, BDO, IFRAME, INPUT, SELECT, TEXTAREA, LABEL, BUTTON, (INS, DEL). Block elements which do have line breaks. May occur in other block elements, cannot occur in inline elements, may contain both block and inline elements. Block elements in HTML 3.2; H1, H2, H3, H4, H5, H6, ADDRESS, P, DL, DT, DD, UL, OL, DIR, MENU, LI, DIV, CENTER, BLOCKQUOTE, PRE, HR, ISINDEX, TABLE, FORM.

Page 11: HTML and DHTML Questions

Block elements in HTML 4.0; P, H1, H2, H3, H4, H5, H6, UL, OL, PRE, DL, DIV, NOSCRIPT, BLOCKQUOTE, FORM, HR, TABLE, FIELDSET, ADDRESS, (INS, DEL). Block elements in HTML 4.0 Transitional; P, H1, H2, H3, H4, H5, H6, UL, OL, DIR, MENU, PRE, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS, (INS, DEL). Parents and children elements which either contain (parents) or are in the content of (children) other elements, e.g. <P>text<STRONG>text</STRONG>text</P>. P is a parent of STRONG. STRONG is a child of P. If not specified otherwise, children will inherit parent's properties. NOTE: not all properties are inherited. For more information, see INHERITANCE. Replaced elements which content is replaced. For example content of the IMG element is replaced with an image, content of the INPUT element is replace with a field. Floating elements which follow the flow of a parent - inline elements. 61. How does inheritance work? A. HTML documents are structured hierarchically. There is an ancestor, the top level element, the HTML element, from which all other elements (children) are descended. As in any other family also children of the HTML family can inherit their parents, e.g. color or size. By letting the children inherit their parents a default style can be created for top level elements and their children. (Note: not all properties can be inherited). The inheritance starts at the oldest ancestor and is passed on to its children and then their children and the children's children and so on. Inherited style can be overridden by declaring specific style to child element. For example if the EM element is not to inherit its parent P then own style must be declared to it. For example: BODY {font-size: 10pt} All text will be displayed in a 10 point font BODY {font-size: 10pt} H1 {font-size: 14pt} or H1 {font-size: 180%} All text except for the level 1 heading will be displayed in a 10 point font. H1 will be displayed in a 14 point font (or in a font that is 80% larger than the one set to BODY).If the element H1 contains other elements, e.g. EM then the EM element will also be displayed in a 14 point font (or 180%) it will inherit the property of the parent H1. If the EM element is to be displayed in some other font then own font properties must be declared to it, e.g: BODY {font-size: 10pt} H1 {font-size: 14pt} or H1 {font-size: 180%} EM {font-size: 15pt} or EM {font-size: 110%} The EM element will be displayed in a 15 point font or will be 10% larger than H1. NOTE: EM is, in this example, inside H1 therefore will inherit H1's properties and not BODY's. The above declaration will display all EM elements in 15 point font or font that is 10% larger than font declared to the parent element. If this specific font is to apply to EM elements but only if they are inside H1 and not every occurrence of EM then EM must take a form of a contextual selector. H1 EM {font-size: 15pt} or H1 EM {font-size: 110%} In the example above EM is a contextual selector. It will be displayed in specified font only if it will be found in the context of H1. Not all properties are inherited. One such property is background. However, since it's initial value is transparent the background of the parent element will shine through by default unless it is explicitly set. 62. Are Style Sheets case sensitive? A. No. Style sheets are case insensitive. Whatever is case insensitive in HTML is also case insensitive in CSS. However, parts that are not under control of CSS like font family names and URLs can be case sensitive - IMAGE.gif and image.gif is not the same file. 63. Which characters can CSS-names contain? A. The CSS-names; names of selectors, classes and IDs can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code. The names cannot start with a dash or a digit. (Note: in HTML the value of the CLASS attribute can contain more characters).

Page 12: HTML and DHTML Questions

64. Can I include comments in my Style Sheet? A. Yes. Comments can be written anywhere where whitespace is allowed and are treated as white space them. Anything written between /* and */ is treated as a comment (white space). NOTE: Comments cannot be nested. /* This is a CSS-comment */ 65. Can Style Sheets and HTML stylistic elements be used in the same document? A. Yes. Style Sheets will be ignored in browsers without CSS-support and HTML stylistic elements used. 66. Which set of definitions, HTML attributes or CSS properties, take precedence? A. CSS properties take precedence over HTML attributes. If both are specified, HTML attributes will be displayed in browsers without CSS support but won't have any effect in browsers with CSS support. 67. Can CSS be used with other than HTML documents? A. Yes. CSS can be used with any structured document format. e.g. XML, however, the method of linking CSS with other document types has not been decided yet (Feb 98). 68. What is the difference between java and java script? A. Java script does support inheritance. It is an object oriented language, not object based... 69. How to validate a Email-address, in Form using JavaScript? A. <form name="validation" onSubmit="return checkbae()"> Please input a valid email address:<br> <input type="text" size=18 name="emailcheck"> <input type="submit" value="Submit"> </form> <script language="JavaScript1.2"> var testresults function checkemail(){ var str=document.validation.emailcheck.value var filter=/^([w-]+(?:.[w-]+)*)@((?:[w-]+.)*w[w-]{0,66}).([a-z]{2,6}(?:.[a-z]{2})?)$/i if (filter.test(str)) testresults=true else{ alert("Please input a valid email address!") testresults=false } return (testresults) } </script> <script> function checkbae(){ if (document.layers||document.getElementById||document.all) return checkemail() else return true } </script> 70. What is javascript and what is it functionality? Ans. # JavaScript was designed to add interactivity to HTML pages # JavaScript is a scripting language (a scripting language is a lightweight programming language) # A JavaScript consists of lines of executable computer code # A JavaScript is usually embedded directly into HTML pages # JavaScript is an interpreted language (means that scripts execute without preliminary compilation)

Page 13: HTML and DHTML Questions

71. How to go next field without filling the text? Which function should use.Phone No Text validation i? Ans .function Validate () { var value=document.getElementById("txtid").value; if (value=="") { } } } 72. How to add a combo box dynamically at run time in Java script? Ans. document.forms[0].<combobox name>.options[index]= new Option(Apearingtext,value) for (var i=0;i<5;i++) { document.forms[0].cmb1.options[i]= new Option("Test"+i,i) } 73. What is the main difference between Client side JavaScript and Server side Java Script. How actually they run on both side with Example? Ans. Client side JavaScript encompasses the core language plus extras such as the predefined objects, only relevant to running JavaScript in a browser. The client side JavaScript is embedded directly in the HTML pages and is interpreted by the browser completely at the run time. Server side JavaScript also encompasses the core language plus extras as the predefined objects and functions only relevant to running JavaScript in a server. The server side java scripts are compiled before they are deployed. 74. What are differences between DIV and SPAN? Ans. 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. 75. What is HTML validation? Ans. It means checks the markup validity of Web documents in HTML Markup Validity: However, just as texts in a natural language can include spelling or grammar errors, documents using Markup languages may (for various reasons) not be following these rules. The process of verifying whether a document actually follows the rules for the language(s) it uses is called validation, and the tool used for that is a validator. A document that passes this process with success is called valid. With these concepts in mind, we can define "markup validation" as the process of checking a Web document against the grammar (generally a DTD) it claims to be using. 76. What is DIV in HTML? Ans. DIV IS SAME AS SPAN BUT IT HAS AN ADDITIONAL PROPERTY OF ALIGN IN IT WITH THE HELP OF WHICH WE CAN ALIGN THE TEXT WITHIN IT, FURTHER IF WE WANT TO PLACE OUR CODE ANYWHERE IN OUR PAGE WE USE DIV TAG AND OUR CODE WITHIN IT.

Page 14: HTML and DHTML Questions

77. What are HTML elements? Ans. HTML documents are text files made up of HTML elements and HTML elements are defined using html tags. <Body> this is my first homepage. <b>this text is bold</b> </body> The HTML element starts with a start tag, <body> then the content of the HTML element This is my first homepage & lastly HTML element ends with an end tag: </body> 78. What is BODY in HTML document? Ans. he body element defines the documents' body. It contains all the contents of the document (like text, images, colors, graphics, etc.). 79. What is meant by iframe? Ans. 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. There are many attributes present in <iframe> and some of the attributes used with <iframe> are namely: NAME: Used for specifying the name of the frame. SCROLL: Used for specifying the scrolling action to be activated. Can take three values namely AUTO, YES or NO.? AUTO will allow the browser to take the decision and activate Scroll bar when needed YES specify scroll bar is needed and NO specifies scroll bar is not needed. ALIGN: This is used for alignment of text and the values that can be taken by it are namely LEFT, RIGHT, TOP, MIDDLE, and BOTTOM. FRAMEBORDER: Used for setting borders, around the frames if needed. A value of 1 set the border around the frame and 0 specify for no border. HEIGHT: Used to specify the height of the frame and this value is mentioned in pixels. HSPACE: Used for specifying horizontal spacing around the frames. 80. What is index document? Ans. Most of the we host we have require index.htm / document because it is a standard for the host-server to look for the document and deploy it. It is the default document to be displayed in the web, in this way. Website is standardize upon their deployment. 81. What are the reasons for validating a HTML? Ans. To ensure one shared HTML coding standard in the World Wide Web To ensure smooth spiderability of the HTML page To ensure better positioning of the HTML in Search Engines 82. What is Empty Elements in HTML? Ans. Empty Elements in HTML depicts that there is no text contained and EMPTY attributes are not permitted to have an end-tag. They are used simply as markers. 83. What is ER Diagram? Ans. The Entity-Relationship (ER) model was originally proposed by Peter in 1976 [Chen76] as a way to unify the network and relational database views. Simply stated the ER model is a conceptual data model that views the real world as entities and relationships. A basic component of the model is the Entity-Relationship Diagram which is used to visually represents data objects. Since Chen wrote his paper the model has been extended and today it is commonly used for database design For the database designer, the utility of the ER model is: it maps well to the relational model. The constructs used in the ER model can easily be transformed into relational tables.

Page 15: HTML and DHTML Questions

it is simple and easy to understand with a minimum of training. Therefore, the model can be used by the database designer to communicate the design to the end user. In addition, the model can be used as a design plan by the database developer to implement a data model in a specific database management software. 84. How do you write the multiple classes in one tag? Ans. Using the following way you can set two classes. <p class="first second"> it will apply two css class named first and second. 85. In CSS how define the space between the elements’s...? Ans. We can have the space between the content border and content by using the cell padding concept. 86. How do you display hyperlinks without an underline...? Ans: A:link { text-decoration: none } ----- for normal, unvisited links, no underline; A:active { text-decoration: none } --- active is for link appearance while you're clicking A:visited { text-decoration: none } --- visited is for previously visited links 87. What is floating elements in CSS? Ans. The question is not entirely correct in its sense. There are HTML elements which you can float with the help of CSS e.g. a DIV element or text/image inside an HTML element. You can use float:[left | right]; property to float HTML elements inside its own container (i.e. its parent element). 88. How do you rate CSS types as per priority and what are the reasons like Embedded, External, Inline? Which one gets top priority and why? Ans. Choosing between External, Embedded and Inline CSS is critical. It is always advisable to think long term. Even when you are working on a smaller module, you never know its future. Moreover, one must remember that CSS is all about 'look and feel' (style) while HTML is content; so better keep them separate. As far as possible, avoid Inline styles. If you are very sure that particular CSS classes are relevant only to the current web page, it might be a good idea to opt for Embedded under certain circumstances. And ofcourse, there are no cons while considering External stylesheet. One thing is very important while using External stylesheets is the nomenclature. There are no fixed set of rules to follow but if you consider a broader view, you can easily work out a fair plan for CSS class names. To start with, one can study some popular websites. 89. What is Importance of Cascade in CSS? Ans. One doesn't have to declare repeating styles for the child elements. E.g. if <body> has a font-name style set to Arial, by default all the elements in the HTML document will inherit this property, unless defined separately. 90. How to Draw a Horizontal Row below a Text in CSS? Ans. We can use text-decoration: underline 91. What is the need for CSS? Ans. To make the downloading to the web pages fast. To make the content different from styles. to maintain the site in same standard and make changes in the style of whole style very fast. 92. What are the two parts of CSS declaration? Ans. Property and value 93. What is the syntax for Grouping in CSS? Ans. For example One can use grouping syntax as below: H1 { font: bold 10pt/16pt helvetica } In the above the properties font-weight, font-size, font-family are combined by using grouping syntax. 94. What is at-rule in CSS? Ans. The at-rule in CSS begins with the at-keyword. It is then followed by '@' character and then the identifier. Some of the at-rule in CSS are '@import', '@page'. 95. What are the ways of creating style sheets? Ans. There are various ways of creating style sheets. The main three ways are listed below namely: * Embedded Style Sheets * External Style Sheets * Inline Styles Let us see each of these in brief. Embedded Style Sheets: Embedded Style Sheets are preset within the web page. This is very useful in making the collection of all the styles applied to the page and making them appear in a common place under the <STLYE> element or tag which is placed in

Page 16: HTML and DHTML Questions

the page header. External Style Sheets: These are style sheets which are stored separately from the web page. The external style sheet has extension as .css. For example Exforsys.css represents as external style sheet. This style sheet is generally used in scenarios when the users want to set the style for the entire web page so that making changes in the external style sheet would get reflected for the entire web page or all the pages which makes use of the embedded style sheet. Inline Styles: If a user wants to set a particular style for a particular element this can be done using Inline styles by making use of the STYLE attribute. The STYLE attribute is different from <STYLE > tag. Thus an inline style is applied only to a particular element. 96. What are the body tags?

Attribute Value Description

alink rgb(x,x,x) # xxxxxx colorname

Specifies the color of the active links in the document. Deprecated. Use styles instead.

background file_name An image to use as the background. Deprecated. Use styles instead.

link Colorname Specifies the color of all the links in the document. Deprecated. Use styles instead.

text rgb(x,x,x) #xxxxxx colorname

Specifies the color of the text in the document. Deprecated. Use styles instead.

vlink rgb(x,x,x) #xxxxxx colorname

Specifies the color of the visited links in the document. Deprecated. Use styles instead.

Standard Attributes

Id, class, title, style, dir, Lang, xml:lang

97. What is XML?

• XML stands for Extensible Markup Language • XML is a markup language much like HTML • XML was designed to carry data, not to display data • XML tags are not predefined. You must define your own tags • XML is designed to be self-descriptive • XML is a W3C Recommendation.

98. The Difference between XML and HTML

Ans. XML is not a replacement for HTML. XML and HTML were designed with different goals:

XML was designed to transport and store data, with focus on what data is.

HTML was designed to display data, with focus on how data looks.

HTML is about displaying information, while XML is about carrying information.

Page 17: HTML and DHTML Questions

99. XML is Not a Replacement for HTML?

Ans. XML is a complement to HTML.

It is important to understand that XML is not a replacement for HTML. In most web applications, XML is used to transport data, while HTML is used to format and display the data. My best description of XML is this: XML is a software and hardware independent tool for carrying information.

100. XML is Used to Create New Internet Languages

Ans. A lot of new Internet languages are created with XML.

• XHTML the latest version of HTML • WSDL for describing available web services • WAP and WML as markup languages for handheld devices • RSS languages for news feeds • RDF and OWL for describing resources and ontology • SMIL for describing multimedia for the web

101. How should I display HTML page without scroll bar, title bar & test?

Ans: Exp: window.open("","newWindow","location=no,status=no,menubar=no,toolbar=no,scrollbars=no,resizable=no, left=250,top=10,width=800,height=850")

Exp:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <style type="text/css"> <!-- body{ border:2px solid black; overflow:hidden; } --> </style> <script language="JavaScript" type="text/javascript"> <!-- function blah(){ if(!opener){//if no opener (and thus: no popup) exists=> open popup var newWin=window.open(this.location.href,'mywin','fullscreen'); newWin.resizeTo(400,200); newWin.focus(); } if(newWin){//if the window is the opener=> close it window.opener = top; window.close(); } } //--> </script> </head> <body onload="blah()"> Imagine this would be your form </body> </html>

Page 18: HTML and DHTML Questions

Exp: <a href="" ONCLICK="window.open('http://www.yahoo.com', 'NewWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resiz able=yes,copyhistory= no,fullscreen=yes')">Don't Click Here </a>

Image display inside the pop up

<html> <head> <SCRIPT language="JavaScript">

*/ function display_image(form) {

selectionname = form.imagename.options[form.imagename.selectedIndex].text;

selection = form.imagename.options[form.imagename.selectedIndex].value;

PreView = window.open("", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0, copyhistory=0,width=200,height=255");

PreView.document.open();

PreView.document.write("<HTML><HEAD>");

PreView.document.write("<TITLE>Preview</TITLE>");

PreView.document.write("</HEAD><BODY BGCOLOR=FFFFFF TEXT=000000>");

PreView.document.write("<FORM><CENTER><B><FONT SIZE=+1>" + selectionname + "</FONT></B><HR>");

PreView.document.write("<IMG HSPACE=0 VSPACE=0 " +"SRC='" + selection + "'>");

PreView.document.write("<HR><FORM><INPUT TYPE='button' VALUE='Close' " +

"onClick='window.close()'></FORM>");

PreView.document.write("</CENTER>");

PreView.document.write("</BODY></HTML>");

PreView.document.close(); }

</SCRIPT><body><FORM>

<select NAME="imagename" onChange="display_image(this.form)">

<option value="http://www.javascriptkit.com/abstract.gif" SELECTED>Image 1

<option value="http://www.javascriptkit.com/day.gif">Image 2

<option value="http://www.javascriptkit.com/night.gif">Image 3

</select></FORM></body><html>

<p align="center"><font face="arial" size="-2">this free script provided by</font><br>

<font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScriptKit</a></font></p>

Page 19: HTML and DHTML Questions

102. What’s relationship between JavaScript and ECMAScript?

Ans - ECMAScript is yet another name for JavaScript (other names include LiveScript).

The current JavaScript that you see supported in browsers is ECMAScript revision 3.

103. What are JavaScript types?

Ans - Number, String, Boolean, Function, Object, Null, Undefined.

104. How do you convert numbers between different bases in JavaScript?

Ans - Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter.

So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);

105. What does isNaN function do?

Ans - Return true if the argument is not a number.

106. What is negative infinity?

Ans- It’s a number in JavaScript, derived by dividing negative number by zero.

107. What boolean operators does JavaScript support?

Ans - &&, || and !

108. What does "1"+2+4 evaluate to?

Ans - Since 1 is a string, everything is a string, so the result is 124.

109. How about 2+5+"8"?

Ans - Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, its concatenation, so 78 is the result.

110. W hat looping structures are there in JavaScript?

Ans - for, while, do-while loops, but no foreach.

111. How do you create a new object in JavaScript?

Ans - var obj = new Object (); or var obj = { };

112. How do you assign object properties?

Ans - obj["age"] = 17 or obj.age = 17.

113. What’s a way to append a value to an array?

Ans - arr[arr.length] = value;

114. What is this keyword?

Ans - It refers to the current object.

Page 20: HTML and DHTML Questions

115. How do you call java script function? Ans. <SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT"> <!-- alert_box(); //--> </SCRIPT> 116. Placing sound on mouse over java script Ans. <script language="javascript" type="text/javascript"> function playSound(soundfile) { document.getElementById("dummy") .innerHTML="<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />"; } </script>

117. How do I add midi music to my web page?

Ans: This can be done quite simply with the below tag.

<bgsound src="music.mid" loop="1">

This tag will play the music.mid once. If you wanted this song to continue without stopping, you would use loop="infinite" instead of the loop="1", which will only play it once. If you needs this to work with Netscape and Internet Explorer, you can use the embed tag to implement music to your page using code similar tot he below example.

<embed src="canyon.mid" Autostart=TRUE Width=145 Height=60 Loop=true>

118. How do I make a picture as a background on my web pages?

Ans. Point the body background to the name of your image you wish to use as the background as shown below. This body line should be the first line after your </head> tag.

<body background="picture.gif">

You can also have the background image fixed, so it does not move when using the scroll bar in the browser. To do this adds the BGPROPERTIES tag as shown below.

<body background="picture.gif" bgproperties="fixed">

119. How do I make it so that someone can mail me by just clicking on text?

Ans. Use the mailto command in your A HREF link tag as shown below.

<A HREF="mailto:[email protected]">Click here to mail ComputerHope</A>

The above example would create a link similar to the one shown below.

Page 21: HTML and DHTML Questions

120. How do I add scrolling text to my page?

Ans. Keep in mind not all browsers support scrolling text. However to do this add a tag similar to the below example.

<Marquee>THIS WOULD SCROLL</marquee>

The above example would create the below scrolling text. If your browser supports scrolling text the below example should be scrolling.

121. How do I do multiple colors of text?

Ans. To do the multicolor text adjusts the color of your font tag as shown below.

<font color="blue">blue</font>

122. How do I make a picture a link?

Ans. Use the A HREF link tag around the IMG image tag as shown below.

<A HREF="http://www.computerhope.com"><IMG SRC="title.gif"></A>

123. How do I make it so that my web page is just one solid color in the background without using an image file?

Ans. Change the BGCOLOR (short for background color) in your body tag as shown below.

<BODY BGCOLOR="white">

124. What is block quotes?

Ans. The <blockquote> tag defines the start of a long quotation. </blockquote>

125. What is div tag?

Ans. The <div> tag defines a division/section in a document.

Exp: <div style="color:#FF0000;"><h4>This is a header in a div section</h4> <p>This is a paragraph in a div section</p></div>

126. What is Xml name space?

Ans. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

127. Definition of param

Ans. The param element allows you to specify the run-time settings for an object inserted into XHTML documents.

Exp: <object classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="Slider1" width="100" height="50"> <param name="BorderStyle" value="1" /> <param name="MousePointer" value="0" /> <param name="Enabled" value="1" />

Page 22: HTML and DHTML Questions

<param name="Min" value="0" /> <param name="Max" value="10" /> </object>

128. What is the core attributes html?

Ans. Not valid in base, head, html, Meta, param, script, style, and title elements.

Attribute Value Description class class_rule or style_rule The class of the element

id id_name A unique id for the element

style style_definition An inline style definition

title tooltip_text A text to display in a tool tip

129. What is the Language attributes?

Ans. Language Attributes

Not valid in base, br, frame, frameset, hr, iframe, param, and script elements.

Attribute Value Description dir ltr | rtl Sets the text direction

lang language_code Sets the language code

130. What are the events attributes?

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

131. Is html is well formed?

Ans. Yes

Exp: <h2 align="center">House Calendar No. 272</h2> 132. What is the difference between DIV tag and Table? Ans. 133. How do I align div with CSS? Ans.

Page 23: HTML and DHTML Questions