Sie sind auf Seite 1von 3

1. What is difference between HTML & XHTML?

Ans: The most important difference between the two markup languages is that HyperText Markup Language, or HTML, is an application of SGML(Standard Generalized Markup Langua ge), 1 and allows an author to 2 omit certain tags and use attribute minimization. The Extensible HyperText Markup Language, or XHTML, is an application of XML (E xtensible Markup Language).3 It doesn't permit the omission of any tags or the use of att ribute minimization. 4 When an XML parser encounters an error relating to the document's well-formed ness, it must abort, whereas an HTML parser is expected to attempt to recover and continue. The Most Important Differences: y y y y XHTML elements must be properly nested XHTML elements must always be closed XHTML elements must be in lowercase XHTML documents must have one roo t element

2. What is difference between HTML & XML? Ans: y y y y y y XML- stands for Extensible Markup Language. XML was designed to transport and store data. XML was designed to carry data, not to display data XML is a markup language mu ch like HTML XML tags are not predefined. You must define your own tags XML is designed to be self-descriptive XML is a W3C Recommendation HTML- stands for Hypertext Markup Language. HTML was designed to display data. y HTML is not a programming language, it is a markup language y A markup language is a set of markup tags y HTML uses markup tags to describe web pages y Start and end tags are also called opening tags and closing tags 3. What is CSS? Ans: CSS stands for Cascading Style Sheet. Style sheets are simply text files (. css ), composed of lines of code that tell browsers how to display an HTML page. CSS can format the document content(written in HTML or other markup language) like layout, colors, fonts. CSS is designed primarily to enable the separation o f the document content and document format. As a result, we can improve content acces sibility, can similarly format two or more documents. Types of CSS:

External Style Sheet- You can separate style sheets from HTML documents. Style sheet files are imported to HTML documents by <link> tag. Internal Style Sheet- You can put style sheet rules in the head of the document by <style> tag. Inline Style Sheet- The start tags can contain style sheet rules directly in HT ML documents by the style attribute.

Advantages of CSS: More Precise Formatting Separation of HTML Content from Appearance Saves Time E asier Site Maintenance Web Accessibility 4. What is difference between Paragraph tag (<p>) & <span> tag? Ans: Paragraph <p> tag is a block element. A block-display element will span the full width of the space available to it, and so will start on a new line in the flow of HTML. The flow will continue on a new line after the block-display element. All HTML elements are naturally displayed in one of the following ways: Block Takes up the full width available, with a new line before and after (disp lay:block;) Inline Takes up only as much width as it needs, and does not force new lines (d isplay:inline;) Not displayed Some tags, like <meta /> and <style> are not visible (display:non e;) Example: <p>, <div>, <h1><h6>, <ul>, <ol>, <dl>, <li>, <dt>, <dd>. <table>, <pre > , <form> etc. <span> tag is a Inline element. Inline-display elements don't break the flow. They just fit in with the flow of the document. Example: <span>, <a>, <strong>, <em>, <img />, <br>, <input> etc.

5. Can we change Block element to Inline & Vice versa? Ans: Yes. By CSS property Display:Block; and Display:Inline;

6. Explain Positions in CSS? Ans: There are total 5 types of positions in CSS. Absolute- Generates an absolutely positioned element, positioned relative to the first parent element that has a position other than s tatic. The element's position is specified with the "left", "top", "right", and "botto m" properties Fixed - Generates an absolutely positioned element, positioned relative to the b rowser window. The element's position is specified with the "left", "top", "right", and "botto m" properties. Relative- Generates a relatively positioned element, positioned relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT position Static - Default. No position, the element occurs in the normal flow (ignores an y top, bottom, left, right, or z-index declarations) Inherit - Specifies that the value of the position property should be inherited from the parent element y

7. What is HTML DOM? Ans: The HTML DOM (Document Object Model) defines a standard way for accessing a nd manipulating HTML documents. The DOM presents an HTML document as a tree-structure. The Docum ent Object Model (DOM) is a cross-platform and language-independent convention for represe nting and interacting with objects in HTML, XHTML and XML documents. [1] Aspects of the DOM (such as its "Elements") may be addressed and manipulated within the syntax of the programming language in use.

8. What is CSS hacks or filter? Ans: A CSS filter is a coding technique used to hide or show CSS markup dependi ng on the browser, version number, or capabilities. Browsers have different interpretations of CSS behavior and different levels of support for the W3C standards. CSS filters are sometimes used to achie ve consistent layout appearance in multiple browsers that do not have compatible rendering. Recommen ded hacks: conditional comment:

Das könnte Ihnen auch gefallen