October 16, 2018

Srikaanth

Sitel Most Frequently Asked Latest HTML Interview Questions Answers

Why Use Style Sheets?

Style sheets allow a much greater degree of layout and display control than has ever been possible thus far in HTML. The amount of format coding necessary to control display characteristics can be greatly reduced through the use of external style sheets which can be used by a group of documents. Also, multiple style sheets can be integrated from different sources to form a cohesive tapestry of styles for a document. Style sheets are also backward compatible - They can be mixed with HTML styling elements and attributes so that older browsers can view content as intended.

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.

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 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 '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 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 same selector.

Declarations with increased weight take precedence over declaration with normal weight

P {color: white ! important} /* increased weight */
P (color: black} /* normal weight */
Sitel Most Frequently Asked Latest HTML Interview Questions Answers
Sitel Most Frequently Asked Latest HTML Interview Questions Answers

Are Style Sheets Case Sensitive?

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.

How Do I Have A Non-tiling (non-repeating) Background Image?

With CSS, you can use the background-repeat property. The background repeat can be included in the short hand background property, as in this example

body {
background: white url(example.gif) no-repeat ;
color: black ;
}

Styles Not Showing?

There are different ways to apply CSS to a HTML document with a stylesheet, and these different ways can be combined

* inline (internal) (Deprecated for XHTML)
* embedded (internal)
* linked (external) and
* @import (external)

Note: An external stylesheet is a text file that contains only CSS Styles. HTML comments are not supposed to be in there and can lead to misinterpretation (> is the CSS "Child" selector!).

How Do I Quote Font Names In Quoted Values Of The Style Attribute?

The attribute values can contain both single quotes and double quotes as long as they come in matching pairs. If two pair of quotes are required include single quotes in double ones or vice versa

<P STYLE="font-family: 'New Times Roman'; font-size: 90%">
<P STYLE='font-family: "New Times Roman"; font-size: 90%'>

It's been reported the latter method doesn't work very well in some browsers, therefore the first one should be used.

What Can Be Done With Style Sheets That Can Not Be Accomplished With Regular Html?

Many of the recent extensions to HTML have been tentative and somewhat crude attempts to control document layout. Style sheets go several steps beyond, and introduces complex border, margin and spacing control to most HTML elements. It also extends the capabilities introduced by most of the existing HTML browser extensions. Background colors or images can now be assigned to ANY HTML element instead of just the BODY element and borders can now be applied to any element instead of just to tables. For more information on the possible properties in CSS, see the Index DOT Css Property Index.

What Is Property?

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.

How Do I Write My Style Sheet So That It Gracefully Cascades With User's Personal Sheet ?

You can help with this by setting properties in recommended places. Style rules that apply to the whole document should be set in the BODY element -- and only there. In this way, the user can easily modify document-wide style settings.

https://mytecbooks.blogspot.com/2018/10/sitel-most-frequently-asked-latest-html.html
Subscribe to get more Posts :