Professional Documents
Culture Documents
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 Language), 1 and allows an author to
omit certain tags and use attribute minimization.2 The Extensible HyperText Markup Language, or
XHTML, is an application of XML (Extensible Markup Language). 3 It doesn’t permit the omission of any
tags or the use of attribute minimization. 4 When an XML parser encounters an error relating to the
document’s well-formedness, it must abort, whereas an HTML parser is expected to attempt to recover
and continue.
Ans:
XML- stands for Extensible Markup Language. XML was designed to transport and store data.
HTML- stands for Hypertext Markup Language. HTML was designed to display data.
HTML is not a programming language, it is a markup language
A markup language is a set of markup tags
HTML uses markup tags to describe web pages
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 of the document content and document format. As a result, we can improve content
accessibility, 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 HTML documents by
the style attribute.
Advantages of CSS:
Ans:
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 (display:block;)
Inline
Takes up only as much width as it needs, and does not force new lines (display:inline;)
Not displayed
Some tags, like <meta /> and <style> are not visible (display:none;)
Example: <p>, <div>, <h1>…<h6>, <ul>, <ol>, <dl>, <li>, <dt>, <dd>. <table>, <pre> , <form> etc.
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.
Absolute- Generates an absolutely positioned element, positioned relative to the first parent
element that has a position other than static. The element's position is specified with the "left",
"top", "right", and "bottom" properties
Fixed - Generates an absolutely positioned element, positioned relative to the browser window.
The element's position is specified with the "left", "top", "right", and "bottom" 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 any top, bottom, left,
right, or z-index declarations)
Inherit - Specifies that the value of the position property should be inherited from the parent
element
Ans: The HTML DOM (Document Object Model) defines a standard way for accessing and
manipulating HTML documents. The DOM presents an HTML document as a tree-structure.
The Document Object Model (DOM) is a cross-platform and language-independent convention for
representing 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.
Ans: A CSS filter is a coding technique used to hide or show CSS markup depending 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 achieve consistent layout
appearance in multiple browsers that do not have compatible rendering.
Recommended hacks:
conditional comment:
<p><!--[if IE]>
According to the conditional comment this is Internet Explorer<br />
<![endif]-->
<!--[if IE 5]>
According to the conditional comment this is Internet Explorer 5<br />
<![endif]-->
<!--[if IE 5.0]>
According to the conditional comment this is Internet Explorer 5.0<br />
<![endif]-->
<!--[if IE 5.5]>
According to the conditional comment this is Internet Explorer 5.5<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is Internet Explorer 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is Internet Explorer 7<br />
<![endif]-->
<!--[if lt IE 6]>
According to the conditional comment this is Internet Explorer lower than 6<br />
<![endif]-->
<!--[if gt IE 6]>
According to the conditional comment this is Internet Explorer greater than 6<br />
<![endif]-->
</p>
Unrecommended hacks:
IE 6 and below
* html {}
IE 7 and below
*:first-child+html {} * html {}
IE 7 only
*:first-child+html {}
IE 7 and modern browsers only
html>body {}
Modern browsers only (not IE 7)
html>/**/body {}
Recent Opera versions 9 and below
html:first-child {}
Ans:
External CSS:
<head>
<link rel="stylesheet" type="text/css" media=”screen” href="(path)/style.css" />
</head>
Internal CSS:
<style type="text/css">……</style>
Inline CSS:
<p style=”color:#00ffff;”>Inline css syntax</p>
Ans:
The float property specifies whether or not a box (an element) should float. With CSS float, an element
can be pushed to the left or right, allowing other elements to wrap around it. This allows naturally-flowing
content to wrap around the floated element.
Ans:
The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the
rules for the markup language, so that the browsers render the content correctly.
The doctype declaration should be the very first thing in an HTML document, before the <html> tag.
The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of
the markup language the page is written in.
Types of DTD:
Ans:
Specificity determines, which CSS rule is applied by browsers. “Specificity is a type of weighting that
has a bearing on how your cascading style sheet (CSS) rules are displayed.”
If two selectors apply to the same element, the one with higher specificity wins.
where both rules have the same specificity 0, 1, 0, 1, the latter rule is always applied.
Ans:
Padding: Padding is the space inside the border between the border and the actual image or cell
contents. Note that padding goes completely around the contents: there is padding on the top, bottom,
right and left sides. Padding cannot be negative.
Margin: Margins are the spaces outside the border, between the border and the other elements next to
this object. Note that, like the padding, the margin goes completely around the contents: there are
margins on the top, bottom, right, and left sides. Margin can be negative.
Ans:
JavaScript-
JQuery-
JQuery is a JavaScript library that handles many commonly used features and also handles the
differences between, e.g., Internet Explorer and standards-compliant browsers. It's something you can
use to reduce the amount of work when creating web-based applications.