What is the difference between class selector and ID selector?
Correct Answer
- Class selector can be given to an overall block This is sometimes termed as block element as well, whereas ID selector identifies a unique name and a style for a specific element - ID selector declares the style for only one particular element which can be differentiated from other element, whereas Class selector is being given for the whole complete block
Correct Answer: CSS consists of two types of CSS rules, first is for ruleset which identifies the style and the selector It combines the style and the selector Ruleset is a combination of CSS rules, for example: h1{text-color: 15pt;}, where this is the CSS rule Ruleset is selector + declaration for example: h1 + {text-color: 15pt;}
Correct Answer: - A web page with large number of images takes a longer time to load This is because each image separately sends out a http request - The concept of CSS sprite helps in reducing this loading time for a web page by combining various small images into one image This reduces the numbers of http request and hence the loading time
Correct Answer: - Basically it is a string that identifies the elements to which a particular declaration or set of declarations will apply - It can also be referred to as a link between the HTML document and the style sheet - It is equivalent of HTML elements For example : A {text-indent: 12pt} Here, the selector is A, which is called as type selector
4. What are different ways to integrate a CSS into a Web page?
Correct Answer: There are three ways to integrate CSS into a Web page 1 Inline: HTML elements may have CSS applied to them via the STYLE attribute 2 Embedded: By placing the code in a STYLE element within the HEAD element 3 Linked/ Imported: Place the CSS in an external file and link it via a link element
5. Differentiate different types of Doctypes from one another.
Correct Answer: Doctype helps the web browser to correctly render the web pages There are different types of Doctype that are available and they are as follows: => Strict Doctype: it consists of all the HTML elements and it is also known as DTD (Document type definition) but it doesn't include the presentational and deprecated elements ie font, center, etc Framesets related elements are also not allowed in this For example: => Transitional Doctype: it consists of all the HTML elements and attributes It is also known as DTD (Document type definition) It includes the presentational and deprecated elements ie font, center, etc Framesets related elements are also not allowed in this For example: => Frameset Doctype: it consists of all the HTML elements and attributes It is also known as DTD (Document type definition) It includes the presentational and deprecated elements ie font, center, etc Framesets related elements are also allowed in this For example:
Correct Answer: Pseudo elements allow the use of the part of element and not the element itself They are applied to block level element, which is used for the complete block for which the CSS is being written This allow the subpart of an element to be styled like paragraphs and headings For example: selector:pseudo-element {property:value;} p: first-line {text-transform: lowercase;} It adds the style to the first line of the code in the paragraph
Correct Answer: Media types in CSS define the media like audio and video to be used in your HTML document to represent the properties in a better way The font property can be used for media types as it can be used for print media or screen media Document requires a defined media to represent the screen that can be read on the paper It is used as:@media ----------Your code here----------
8. What are the advantages of the external over inline style methods?
Correct Answer: - External Style Sheets are useful as it keeps the style and content separately and doesn?t allow it to mix with each other It can control the styles for multiple documents, whereas inline style mixes the content with the style and make the code messier - External style sheet allows the creation of various classes in a structured way, whereas inline style sheet can?t create or control class elements - External style sheet can use selector and grouping methods to apply styles, whereas inline styles can?t use selector and grouping methods
Correct Answer: JavaScript: - JavaScript is a scripting language developed by Netscape Communications - The Netscape Navigator interprets JavaScript embedded into Web pages - JavaScript is used for developing web applications - It is not dependent on Sun Microsystem's Java language JScript: - Microsoft JScript is an open implementation of Netscape's JavaScript - JScript is a scripting language designed to create active online content ActiveX controls, Java programs, etc can be linked and automated in the web pages using JScript
10. What is the difference between Client side JavaScript and Server side JavaScript.
Correct Answer: Client side java script comprises the basic language and predefined objects which are relevant to running java script in a browser The client side java script is embedded directly by in the HTML pages This script is interpreted by the browser at run time Server side java script also resembles like client side java script It has relevant java script which is to run in a server The server side java scripts are deployed only after compilation