April 23, 2019

Srikaanth

Facebook CSS Interview Questions Answers

What Is Embedded Style? How To Link?

Embedded style is the style attached to one specific document. The style information is specified as a content of the STYLE element inside the HEAD element and will apply to the entire document.

The Pack contains nearly 14 plus software . Pick the one which is suited for you Make your PC more useful. Get the free Google Pack.

<HEAD>
<STYLE TYPE="text/css">
<!--
P {text-indent: 10pt}
-->
</STYLE>
</HEAD>

Note: The styling rules are written as a HTML comment, that is, between <!-- and --> to hide the content in browsers without CSS support which would otherwise be displayed.
Facebook Most Frequently Asked Latest CSS Interview Questions Answers
Facebook Most Frequently Asked Latest CSS Interview Questions Answers

What Is Id Selector?

ID selector is an individually identified (named) selector to which a specific style is declared. Using the ID attribute the declared style can then be associated with one and only one HTML element per document as to differentiate it from all other elements. ID selectors are created by a character # followed by the selector'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 characteras a numeric code, however, they cannot start with a dash or a digit.

#abc123 {color: red; background: black}

<P ID=abc123>This and only this element can be identified as abc123 </P>

How Do I Have A Fixed (non-scrolling) Background Image?

With CSS, you can use the background-attachment property. The backgroundattachment can be included in the shorthand background property, as in this example

body {
background: white url(example.gif) fixed ;
color: black ;
}

Note that this CSS is supported by Internet Explorer, Mozilla, Firefox Opera, Safari, and other browsers. In contrast, Microsoft's proprietary BGPROPERTIES attribute is supported only by Internet Explorer.

What Are Pseudo-classes?

Pseudo-classes are fictional element types that do not exist in HTML. In CSS1 there is only one element type which can be classed this way, namely the A element(anchor). By creating three fictional types of the A element individual style can be attached to each class. These three fictional element types are: A as unvisited link, A as active link and A as visited link. Pseudo-classes are created by a colon followed by pseudo-class's name. They can also be combined with normal classes

example

A:link {background: black; color: white}
A:active {background: black; color: red}
A:visited {background: transparent; color: black}
<A HREF....>This anchor (or rather these anchors) will be displayed as declared above</A>
A.foot:link {background: black; color: white}
A.foft:active {background; black: color: red}
A.foot:visited {background: transparent; color: black}
<A CLASS=foot HREF....>This anchor and all other anchors with CLASS foot will be displayed as declared above</A>

Can Style Sheets And Html Stylistic Elements Be Used In The Same Document?

Yes. Style Sheets will be ignored in browsers without CSS-support and HTML stylistic elements used.

Can Css Be Used With Other Than Html Documents?

Yes. CSS can be used with any ny structured document format. e.g. XML, however, the method of linking CSS with other document types has not been decided yet.

Some Examples Of Good And Bad Coding. What Is Wrong With This?

<font size="3">Welcome to my page</font>

Comment: The font-tag is design and design shouldn’t be in the HTML document. All design should be in the CSS-file! Instead do this

In the HTML

<h1>Welcome to my page</h1>

In the CSS

h1 { font-size: 2em; }

One more example

<b>An error occurred</b>

This looks right doesn’t it? But if you look up what <b> stands for you quickly find bold. But bold is certainly design, so it still doesn’t belong in the HTML document. A better choice is <em> that stands for emphasis or simply “this piece of text is important”. So instead of saying “this text looks like this” you are saying “this text is important” and you let the looks be decided by the CSS. Seems like a minor change, but it illustrates how to select your tags. Use this instead

In the HTML

<em>An error occured</em>

In the CSS

em {
font-weight: bold;
color: Red;
}
One last example
<table>
<tr><td><a href="">first link</a></td></tr>
<tr><td><a href="">second link</a></td></tr>
...
</table>

How To Use Css To Separate Content And Design?

The idea here is that all sites contain two major parts, the content: all your articles, text and photos and the design: rounded corners, colors and effects. Usually those two are made in different parts of a webpage’s lifetime. The design is determined at the beginning and then you start filling it with content and keep the design fixed.

In CSS you just add the nifty <link>-tag I’ve told you about to the head of yourHTML document and you have created a link to your design. In the HTML documentyou put content only, and that link of yours makes sure it looks right. You can also use the exact same link on many of your pages, giving them all of them the same design. You want to add content? Just write a plain HTML document and think about marking things up like “header” instead of “big blue header” and use CSS to make all headers look the way you want!

Why Was The Decision Made To Make Padding Apply Outside Of The Width Of A Box, Rather Than Inside, Which Would Seem To Make More Sense?

It makes sense in some situations, but not in others. For example, when a childelement is set to width: 100%, I don't think it should cover the padding of its parent. The box-sizing property in CSS3 addresses this issue. Ideally, the issue should have been addressed earlier, though.

Why Call The Subtended Angle A Pixel, Instead Of Something Else (e.g. Subangle)?

In most cases, a CSS pixel will be equal to a device pixel. But, as you point out, the definition of a CSS pixel will sometimes be different. For example, on a laser printer, one CSS pixel can be equal to 3x3 device pixels to avoid printing illegibly small text and images. I don't recall anyone ever proposing another name for it. Subangle? Personally, I think most people would prefer the pragmatic "px" to the non-intuitive "sa".

How Do I Eliminate The Blue Border Around Linked Images?

in your CSS, you can specify the border property for linked images

a img { border: none ; }

However, note that removing the border that indicates an image is a link makes it harder for users to distinguish quickly and easily which images on a web page are clickable.

Which Property Is Used To Change The Face Of A Font?

The font-family property is used to change the face of a font.

Which Property Is Used To Make A Font Italic Or Oblique?

The font-style property is used to make a font italic or oblique.

Which Property Is Used To Create A Small-caps Effect?

The font-variant property is used to create a small-caps effect.

What Is A Style Sheet?

Style sheets are the way that standards-compliant Web designers define the layout, look-and-feel, and design of their pages. They are called Cascading Style Sheets or CSS. With style sheets, a designer can define many aspects of a Web page

* fonts
* colors
* layout
* positioning
* imagery
* accessibility

Style sheets give you a lot of power to define how your pages will look. And another great thing about them is that style sheets make it really easy to update your pages when you want to make a new design. Simply load in a new style sheet onto your pages and you're done.

What Is Inline Style? How To Link?

Inline style is the style attached to one specific element. The style is specified directly in the start tag as a value of the STYLE attribute and will apply exclusively to this specific element occurrence.

<P STYLE="text-indent: 10pt">Indented paragraph</P>

Why Do Style Sheets Exist?

SGML (of which HTML is a derivative) was meant to be a device-independent method for conveying a document's structural and semantic content (its meaning.) It was never meant to convey physical formatting information. HTML has crossed this line and now contains many elements and attributes which specify visual style and formatting information. One of the main reasons for style sheets is to stop the creation of new HTML physical formatting constructs and once again separate style information from document content.

What Are Style Sheets?

Style Sheets are templates, very similar to templates in desktop publishing applications, containing a collection of rules declared to various selectors(elements).

What Is Css Rule Ruleset?

There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector orselectors and declares style which is to be attached to that selector or selectors. For example P {text-indent: 10pt} is a CSS rule. CSS rulesets consist of two parts:selector, e.g. P and declaration,

e.g. {text-indent: 10pt}.
P {text-indent: 10pt} - CSS rule (ruleset)
{text-indent: 10pt} - CSS declaration
text-indent - CSS property
10pt - CSS value.

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

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

Which Property Is Used To Control The Repetition Of An Image In The Background?

The background-repeat property is used to control the repetition of an image in the background.

Which Property Is Used As Shorthand To Specify A Number Of Other Font Properties?

The font property is used as shorthand to specify a number of other font properties.

Subscribe to get more Posts :