CSS Technical Interview Questions For Freshers

What is CSS? CSS is a standard for applying style to HTML elements. This styling includes margins, positioning, fonts, colors, and so fo...

What is CSS?
CSS is a standard for applying style to HTML elements. This styling includes margins, positioning, fonts, colors, and so forth. The styling can apply to the complete document or be granular and apply to a specific element. Theoretically, the use of CSS promotes the separation of content and design, allowing the designer to focus on how a Web application will look while the developer(s) concentrate on the structure and functionality.

What does the cascading portion of CSS mean?
Cascading refers to cascading order. It is a system of sorting the various CSS declarations to avoid conflicts. The process begins with a search for all declarations that apply to specific elements; it ends if no match is found. Cascading occurs if multiple styles are defined for an element. In general, values will be applied from the more specific style sheet.

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

Describe features of CSS?
 CSS use some features to define fonts, colors, layout, etc. The content is separated from the design part which makes content visible thereby enhancing productivity of the complete process. Same page is made to appear in various formats.

What Are The uses of CSS? 
Various possibilities are offered to developer and designer by CSS. Some of them are given below: • Complete style sheet coding is moved to isolated external folder.
 • CSS is made rich because it contains code reuse and repetition.
 • Structure and presentation are made different by CSS etc.

Describe CSS filter? 

The difficulties faced by designers and developers are solved using CSS filter. These filters are used to write completely different code or change the current design patterns so that the CSS specifications are received by the browsers. Thus, browsers are not allowed to make any changes which are not required.

What is an ID selector?
An ID selector is a name assigned to a specific style. In turn, it can be associated with one HTML element with the assigned ID. Within CSS, ID selectors are defined with the # character followed by the selector name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, and so forth.

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.

What is the difference between an ID selector and CLASS? 
An ID selector identifies and sets style to only one occurrence of an element, while CLASS can be attached to any number of elements.

What is contextual selector?
Contextual selector addresses specific occurrence of an element. It is a string of individual selectors separated by white space (search pattern), where only the last element in the pattern is addressed providing it matches the specified context.

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.
Indented paragraph

What are child selectors?
A child selector is used when you want to match an element that is the child of another specific element. The parent and child selectors are separated by spaces. The following selector locates an unordered list element within a paragraph element and makes a text within that element bold.

What is grouping? 
When more than one selector shares the same declaration, they may be grouped together via a comma-separated list; this allows you to reduce the size of the CSS (every bit and byte is important) and makes it more readable. The following snippet applies the same background to the first three heading elements.

What is the "Box Model" in CSS? Which CSS properties are a part of it?
The CSS box model is fundamental to understanding layout and sizing and such. It's made up of:
Width and height (or in the absence of that, default values and the content inside)

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.

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.

How many types we can write the css style sheets?
  • Inline style sheet 
  • Internal style sheet 
  • External style sheet
What is the difference between css2 and css3?
The biggest difference between CSS2 and CSS3 is that CSS3 has been split up into different sections, called modules. Each of these modules is making it’s way through the W3C in various stages of the recommendation process.

What are the rules to be followed for CSS-names? 
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.

How do you include comments in CSS?
Anything placed between /* and */ in CSS is considered a comment. Comments are ignored by the browser Have you utilized any CSS libraries or frameworks? The answer to this question will not be standard, but it gives you an idea of a candidate's familiarity with the landscape. Possible answers include the YUI Library or YAML, but there are plenty more out there.

What is shorthand property? 
 Shorthand property is a property made up of individual properties that have a common "addressee". For example properties: font-weight, font-style, font-variant, font-size, font-family, refer to the font. To reduce the size of style sheets and also save some keystrokes as well as bandwidth they can all be specified as one shorthand property font

What is value?
Value is a 'physical' characteristic of the property. Property declares what should be formatted, e.g. FONT while value suggests how the property should be formatted, e.g. 12pt. By setting the value 12pt to the property FONT it is suggested that the formatted text be displayed in a 12 point font. There must always be a corresponding property to each value or set of values.

How To Style Table Cells?
Margin, Border and Padding are difficult to apply to inline elements. Officially, the <TD>
tag is a block level element because it can contain other block level elements (see Basics - Elements). If you need to set special margins, borders, or padding inside a table cell, then use this markup:
yourtext </div></td>

to apply the CSS rules to the div inside the cell.</p>

Describe internet explorer box model bug?
Designers had tough time while dealing with this bug because box widths are not displayed perfectly on the web page. The block is displayed to be in narrow size. Hacks and CSS filter are used to rectify this bug. This problem can also be solved with correct usage and documentation of XHTML.

What is Tweening? 
t is the short form for in-betweening. - It is the process of generating intermediate frames between two images. - It gives the impression that the first image has smoothly evolved into the second one. - It is an important method used in all types of animations. - In CSS3, Transforms(matrix,translate,rotate,scale etc) module can be used to achieve tweening.

Explain RWD.
RWD is the abbreviation for Responsive web design. 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.


Interview Questions 4800651815711595593

Post a Comment

Follow Us

Hot in week



Side Ads