Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

CSS Interview Questions and Answers

Ques 21. What is a Style Sheet?

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

Is it helpful? Add Comment View Comments
Ques 22. What is alternate Style Sheet? How to link?
Ans. 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.:

<LINK REL=Stylesheet HREF=\"style.css\" TYPE=\"text/css\">

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

<LINK REL=Stylesheet HREF=\"style2.css\" TYPE=\"text/css\" TITLE=\"appropriate style description\">

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

<LINK REL=\"Alternate Stylesheet\" HREF=\"style3.css\" TYPE=\"text/css\" TITLE=\"appropriate style description\" MEDIA=screen>
<LINK REL=\"Alternate Stylesheet\" HREF=\"style4.css\" TYPE=\"text/css\" TITLE=\"appropriate style description\" MEDIA=print>

Alternate stylesheet are not yet supported.
Is it helpful? Add Comment View Comments
Ques 23. How can you set a minimum width for IE?
Ans. 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...


<!--[if gte IE 5]> <style type=\"text/css\">
body {
width:expression(documentElement.clientWidth < 780 ? (documentElement.clientWidth == 0 ? (body.clientWidth < 780 ? \"780px\" : \"auto\") : \"780px\") : \"auto\" );
}
</style>
<![endif]-->

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.
Is it helpful? Add Comment View Comments
Ques 24. Which browsers support CSS?
Ans. 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.
Is it helpful? Add Comment View Comments
Ques 25. How do I place text over an image?
Ans. 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.

<div style=\"position: relative; width: 200px; height: 100px\">
<div style=\"position: absolute; top: 0; left: 0; width: 200px\">

</div>
<div style=\"position: absolute; top: 20%; left: 20%; width: 200px\">
Text that nicely wraps
</div>
</div>
Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2016 WithoutBook