• +91 9723535972
  • info@interviewmaterial.com

CSS Interview Questions and Answers

Related Subjects

CSS Interview Questions and Answers

Question - 21 : - What is a Style Sheet?

Answer - 21 : - 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.

Question - 22 : - What is alternate Style Sheet? How to link?

Answer - 22 : - Alternate Style Sheet is a sheet defining an alternate style to be used in place of style(s) declared as persistent and/or preferred . Persistent style is a default style that applies when style sheets are enabled but can disabled in favor of an alternate style, e.g.: Preferred style is a default style that applies automatically and is declared by setting the TITLE attribute to the LINK element. There can only be one preferred style, e.g.: Alternate style gives an user the choice of selecting an alternative style - a very convenient way of specifying a media dependent style. Note: Each group of alternate styles must have unique TITLE, e.g.: Alternate stylesheet are not yet supported.

Question - 23 : - How can you set a minimum width for IE?

Answer - 23 : - To set a minimum width, the CSS property is 'min-width'. This can be very useful and works well in good browsers. IE doesn't understand 'min-width'. However, it has a proprietary property called 'expression' which allows us to feed it javascript via a stylesheet. Below is how to set a (780px) minimum width for IE... As the property is non-standard, it won't validate with the W3C validator, so if we put it in the head like this (above) - in an IE conditional comment - the validator will ignore it and the page will get a clean bill of health.

Question - 24 : - Which browsers support CSS?

Answer - 24 : - It depends on your definition of "support." If you are interested in those browsers which makes some attempt at supporting CSS, no matter how partial or bug-ridden, then the list is: * Internet Explorer 3.0 and above * Navigator 4.0 and above * Opera 3.6 and above * Konqueror * Arena * Emacs-w3 * Amaya * Lexicon * XPublish by Media Design in·Progress If instead you're interested in those browsers which are known to do a credible job of bug-free and mostly completel support for CSS1, then the list narrows somewhat dramatically: * Internet Explorer 5.0 for Macintosh and above * Internet Exporer 5.5 for Windows and above * Netscape Navigator 6.0 and above * Opera 4.0 and above While none of these browser can be claimed to have a perfect implementation of CSS1, they are all quite good and can be relied upon to operate in a consistent fashion for most of CSS1.

Question - 25 : - How do I place text over an image?

Answer - 25 : - To place text or image over an image you use the position property. The below exemple is supported by IE 4.0. All you have to do is adapt the units to your need.

Text that nicely wraps

Question - 26 : - what CSS is, why not start coding?

Answer - 26 : - CSS is sort of like scripting language made for the web. In contrary with HTML, DHTML, JavaScript, VBScript and many others. CSS is strictly for formatting your web-page and now many new browser support it. (NOTE: Older browser do not support CSS, so please check your browser version and make sure whether it supports it or not. You may have to update your current Browser.) The way the code goes into your Web-page is through a variety of ways. The way CSS works is that is the code is set between the tags. You can put the CSS code after which is what most people do. Now, here are the following ways of making your webpage with CSS enabled features: 1.) Writing your CSS code within your HTML source code. This is how it would look like: My First CSS! 2.) Linking to your CSS file. This tells the webpage to find the .css file and use it as the CSS code. Here is the code that would allow you to do: CSS As you can see from the code above, the tag is pretty helpful. What it does is that it links to the style.css file which has all the css code. Just like embedding an image throught he tag. Now to explain a bit from the first example. CSS code isn't very hard to understand.Take for example the body { ..} part. What it does is that it formats how the tag in HTML would work. That is a very

Question - 27 : - How to customize your textboxes?

Answer - 27 : - Here is the code on how to do it: That above code, has some similarities. The textbox area is treated with the same function statements as for the scrollbar. The scrollbar statements goes in the BODY selector.

Question - 28 : - Why does my content shift to the left on some pages (in FF)?

Answer - 28 : - That'll be the pages with more content? The ones that have a vertical scrollbar? If you look in IE there's probably a white space on the right where there would be a scrollbar if there were enough content to require one. In Firefox, the scrollbar appears when it's needed and the viewport becomes about 20px smaller, so the content seems to shift to the left when you move from a page with little content to one with lots of content. It's not a bug or something that needs to be fixed, but it does confuse and irritate some developers. If, for some reason, you'd like Firefox to always have scrollbars - whether they're needed or not - you can do this : CSS html { height:100.1%; }

Question - 29 : - How do I combine multiple sheets into one?

Answer - 29 : - To combine multiple/partial style sheets into one set the TITLE attribute taking one and the same value to the LINK element. The combined style will apply as a preferred style, e.g.:

Question - 30 : - What is attribute selector?

Answer - 30 : - Attribute selector is a selector defined by 1) the attribute set to element(s), 2) the attribute and value(s), 3) the attribute and value parts: 1a) A[title] {text-decoration: underline} All A elements containing the TITLE attribute will be underlined 1b) A[class=name] {text-decoration: underline} The A elements classed as 'name' will be underlined 2) A[title="attribute element"] {text-decoration: underline} The A elements containing the TITLE attribute with a value that is an exact match of the specified value, which in this example is 'attribute element', will be underlined 3) A[title~="attribute"] {text-decoration: underline} The A elements containing the TITLE attribute with a value containing the specified word, which in this example is 'attribute', will be underlined


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners