CDW Most Frequently Asked Latest CSS Interview Questions Answers

What Is Cascade?

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

Declarations with increased weight take precedence over declaration with normal weight

P {color: white ! important} /* increased weight */
P (color: black} /* normal weight */

What Is Important Declaration?

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.

What Is Css Declaration?

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.

What Is Class Selector?

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>

Which Property Is Used To Set The Text Shadow Around A Text?

The text-shadow property is used to set the text shadow around a text.
CDW Most Frequently Asked Latest CSS Interview Questions Answers
CDW Most Frequently Asked Latest CSS Interview Questions Answers

How Css Style Overriding Works?

Following is the rule to override any Style Sheet Rule

Any inline style sheet takes highest priority. So, it will override any rule defined in <style>...</style> tags or rules defined in any external style sheet file.

Any rule defined in <style>...</style> tags will override rules defined in any external style sheet file.

Any rule defined in external style sheet file takes lowest priority, and rules defined in this file will be applied only when above two rules are not applicable.

What Is The Purpose Of % Measurement Unit?

% - Defines a measurement as a percentage relative to another value, typically an enclosing element.

p {font-size: 16pt; line-height: 125%;}

What Is The Purpose Of Cm Measurement Unit?

cm − Defines a measurement in centimeters.

div {margin-bottom: 2cm;}

What Is The Purpose Of Em Measurement Unit?

em − A relative measurement for the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each "em" unit would be 12pt; thus, 2em would be 24pt.

p {letter-spacing: 7em;}

What Is The Purpose Of Ex Measurement Unit?

ex − This value defines a measurement relative to a font's x-height. The x-height is determined by the height of the font's lowercase letter.

p {font-size: 24pt; line-height: 3ex;}

What Are Advantages Of Using Css?

Following are the advantages of using CSS −
•CSS saves time − You can write CSS once and then reuse same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.
•Pages load faster − If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.
•Easy maintenance − To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.
•Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes.
•Multiple Device Compatibility − Style sheets allow content to be optimized for more than one type of device. By using the same HTML document, different versions of a website can be presented for handheld devices such as PDAs and cell phones or for printing.
•Global web standards − Now HTML attributes are being deprecated and it is being recommended to use CSS. So its a good idea to start using CSS in all the HTML pages to make them compatible to future browsers.
•Offline Browsing − CSS can store web applications locally with the help of an offline catche.Using of this, we can view offline websites.The cache also ensures faster loading and better overall performance of the website.
•Platform Independence − The Script offer consistent platform independence and can support latest browsers as well.

What Is The Purpose Of Vmin Measurement Unit?

vmin 1vw or 1vh, whichever is smaller.

p { font-size: 2vmin;}

What Are Browser Safe Colors?

There is the list of 216 colors which are supposed to be most safe and computer independent colors. These colors vary from hexa code 000000 to FFFFFF. These colors are safe to use because they ensure that all computers would display the colors correctly when running a 256 color palette.

Which Property Is Used To Set The Background Color Of An Element?

The background-color property is used to set the background color of an element.

Which Property Is Used To Set The Color Of A Text?

The color property is used to set the color of a text.

Which Property Is Used To Set The Text Direction?

The direction property is used to set the text direction.

What Is Selector?

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

What Is Css Rule At-rule ?

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.

As A Reader, How Can I Make My Browser Recognize My Own Style Sheet?

Netscape

It is not possible to do this in Netscape yet (as of version 4.0.)

Internet Explorer 3.0 (Win95/NT)

[It is possible to do this at least in Windows95/NT, but no user interface is provided. Unknown how this might be accomplished on other operating systems.]

1. Open the Registry editor (Start..Run..regedit..ENTER)
2. Under the 'HKEY_LOCAL_MACHINESoftwareMicrosoftInternetExplorerStyles' key, Edit..New..String Value
3. The new value should be called 'StyleSheet Pathname'
4. For the value, type in the full directory path of your .css style sheet.

Internet Explorer 4.0 (Win95/NT)

1. Under the View menu, select 'Internet Options'.
2. Under the 'General' tab, choose the 'Accessibility' button.
3. Choose the 'Format documents using my style sheet' check box and 'Browse...' to the location of your .css style sheet.

Post a Comment

Previous Post Next Post