Css Interview Questions

1.What are Cascading Style Sheets?

A.Cascading Style Sheet (CSS) is a list of statements (also known as rules) that can assign various rendering properties to HTML elements. Style rules can be specified for a single element occurrence, multiple elements, an entire document, or even multiple documents at once. It is possible to specify many different rules for an element in different locations using different methods. All these rules are collected and merged (known as a "cascading" of styles) when the document is rendered to form a single style rule for each element.

2.What are different ways to integrate a CSS into a Web page?

A.There are three ways to integrate a CSS into wep page.a) External Style Sheet. b) Internal/Embedded Style Sheet.c)Inline Style Sheet.

3.Explain external Style Sheet? How would you link to it?

A.External Style Sheet can be called as a template/document/file which contains style information and can be linked with more than one HTML documents. Using this the entire site can be formatted and styles just by editing one file.The file is linked with HTML documents via the LINK element inside the HEAD element. .

4.What are the advantages and disadvantages of External Style Sheets?

A.Using them, the styles of multiple documents can be controlled from one file.Classes can be created for use on multiple HTML element types in many documents.In complex situations, selector and grouping methods can be used to apply styles.

5. What are the advantages and disadvantages of Embedded Style Sheets?

A.The advantages of Embedded Style Sheets are: - It is possible to create classes for use on multiple tag types in the document.Under complex situations, selector and grouping methods can be used to apply styles. No extra download is required to import the information. The disadvantages of Embedded Style Sheets are: - It is not possible to control the styles for multiple documents from one file, using this method.

6.Explain external Style Sheet? How would you link to it?

A.External Style Sheet can be called as a template/document/file which contains style information and can be linked with more than one HTML documents. Using this the entire site can be formatted and styles just by editing one file. The file is linked with HTML documents via the LINK element inside the HEAD element. <HEAD> <LINK REL=STYLESHEET HREF="style.css" TYPE="text/css"> </HEAD>

7.What are the advantages and disadvantages of External Style Sheets?

A.The advantages of External Style Sheets are: Using them, the styles of multiple documents can be controlled from one file. Classes can be created for use on multiple HTML element types in many documents. In complex situations, selector and grouping methods can be used to apply styles. The disadvantages of External Style Sheets are: In order to import style information for each document, an extra download is needed. Until the external style sheet is loaded, it may not be possible to render the document. For small number of style definitions, it is not viable.

8.How internal/embedded style can be linked with HTML documents?

A.Embedded style is inside the HTML code only. It is written using the <Style> tag and used under the <Head> structure. It gets applied to the element for which the style will be written. The syntax of it is as follows: <HEAD> <STYLE TYPE="text/css"> p {text-indent: 10pt;} h1{text-color: #FFFFFF;} </STYLE> </HEAD>

9. What are the advantages and disadvantages of Internal/Embedded Style Sheets?

A.The advantages of Internal Style Sheets are: It is possible to create classes for use on multiple tag types in the document Under complex situations, selector and grouping methods can be used to apply styles. No extra download is required to import the information. The disadvantages of Internal Style Sheets are: It is not possible to control the styles for multiple documents from one file, using this method.

10.List various font attributes used in style sheet?

A.font-style, font-variant, font-weight, font-size/line-height, font-family, caption, icon, menu, message-box, small-caption, status-bar

11.What are style sheet properties?

A.CSS Background, CSS Text, CSS Font, CSS Border, CSS Outline, CSS Margin, CSS Padding, CSS List, CSS Table.

12.Which property is used to change the left margin of an element?

A.margin-left

13.How do you make the text bold?

A.font-weight:bold;

14.How do you display hyperlinks without an underline?

A.a {text-decoration:none;}

15.What is the correct CSS syntax for making all the elements bold?

A.p {font-weight:bold;}

16.Which CSS property controls the text size?

A.font-size

17.Which CSS property is used to change the text color of an element?

A.color

18.How do you add a background color for all

elements?

A.h1 {background-color:#FFFFFF;}

19.Which property is used to change the background color?

A.background-color

20.How do you insert a comment in a CSS file?

A./* this is a comment */

21.Which is the correct CSS syntax?

A.body {color: black;}

22.Which HTML attribute is used to define inline styles?

A.style

23.Where in an HTML document is the correct place to refer to an external style sheet?

A.In the <head> section

24.What is CSS selector?

A.Basically it is a string that identifies the elements to which a particular declaration or set of declarations will apply. It can also be referred to as a link between the HTML document and the style sheet. It is equivalent of HTML elements. For example : A {text-indent: 12pt} Here, the selector is A, which is called as type selector.

25. What is the difference between class selector and ID selector?

A.Class selector can be given to an overall block. This is sometimes termed as block element as well, whereas ID selector identifies a unique name and a style for a specific element. ID selector declares the style for only one particular element which can be differentiated from other element, whereas Class selector is being given for the whole complete block. Example of ID selector is being written like this: #idname {color: red; background: black;} This can be used in HTML as <P ID= "idname">this element only will be affected by the use of this ID element</P>

26. How grouping happens inside a CSS?

A.Grouping in CSS can be done by using the comma (,) separator in between one or more selectors that share the same style. A list of separator can be separated by using a semicolon as well. For example: H1 {font-style: italic} p.first {font-style: italic} .name {font-style: italic} In this example all the css element share the same style so instead of writing like that it can be written as: H1, p.first, .name {font-style: italic} This reduces the size of the style sheet and also save the writing time for those sheets.

27.How to center the block-elements with CSS?

A.body {width: 30em; background: cyan;} h1 {width: 22em; margin-left: auto; margin-right: auto}

28.How CSS float works?

A.CSS float is useful when you don't have to give width for an element or you don't want to keep the element fixed. It allows the elements to be given left or right boundaries to expand and wrap all other elements. Float is basically used for images and for layouts. Elements in this can be made float horizontally i.e. left or right. For example: img {float:right;}

29.Why CSS Box Model is used? What are the elements that it includes?

A.CSS box model defines the design and layout of the styling element. It is a box that shows the elements that will come before others. Like, it consists of margins, borders, padding, and the actual content. It allows a structured way to show the elements in comparison to other elements. The terms that are used in box model is shown as:  Margin  it shows the top most layer and it shows the overall structure which consists of border and other elements that is being shown below.  Border  it shows the padding and content option and keep a border around it. Border can be affected by background color.  Padding  it shows the space between the content blocks. It is affected by the background color.  Content  it shows the actual content like text and images.

30.Write the css code showing the usage of all the background properties

A.BODY { font-family : "Verdana, Arial, Helvetica, sans-serif; background-image: url(images/background_image.gif); background-repeat: no-repeat; background-position: center; background-attachment: fixed; background-color: #FF00FF; color : #FF0000; margin: 20px; }

31.Why should inline styles be used carefully?

A.Inline style rules allows a user to attach individual styles to individual elements in an HTML document. Th syntax of an inline style rule attached to an HTML element: <p style="color: red;"> Red text</p> Inline styles are generally not the preferred way of applying a style rule and must be used carefully because of the following reasons: 1. The style rules can easily get mixed up in an HTML page code. 2. The entire rule must be specified in the value of the style attribute, this can be tough in case of long rules. 3. By using inline styles the user is unable to take advantage of CSS properties such as grouping selectors and re usability of a style sheet. It is generally advised to use either internal or external style sheets as they are more convenient to manage and can be changed easily as they are at the same place.

32.Explain what are image sprites and how are they used in css

A.Image sprites are basically a collection of images put into a single image. A web page can contain multiple images and loading them all one by one can be a slow process. By using image sprites only a single image is used and by specifying the area of the image to be displayed the same image can be used multiple times. For ex. we have a an image.gif which contains the home, forward and back navigation buttons. With the help of css the user can simply specify only the part of the image that is needed. Now the user wants to only display the home part of the image for the home button. CSS code: img.home { width:50px; height: 44px; background: url (image.gif) 0 0 ; }

33.What is the purpose of the z-index?

A.While using css to position html elements they may overlap each other. The z index i used to specify which element overlaps which element. The z-index is a number which can either have a positive or a negative value. By default the z-index value is zero. In case elements have the same z-index number specified then the browser will layer them according to the order in which they appear in the HTML.

34.How are shorthand properties are used in css?

A.One of the primary advantages of css is that it greatly reduces page load times. Writing multiple properties and their values in a single line of css code is known as css shorthand technique. One thing to be kept in mind is that while using the css shorthand technique is that the order of specifying the values of an attribute must be maintained. In case the user wants to keep a value as default it is not needed to be mentioned. For ex. margin-top: 5em; margin-bottom: 3em; margin-right: 1em; margin-left: 1em; Becomes: margin: 5em 1em 3em (top, right and left, bottom);

35.Is CSS case sensitive?

A.Cascading Style Sheets (CSS) is not case sensitive. However, font families, URLs to images, and other direct references with the style sheet may be. The trick is that if you write a document using an XML declaration and an XHTML doctype, then the CSS class names will be case sensitive for some browsers. It is a good idea to avoid naming classes where the only difference is the case, for example: div.myclass { ...} div.myClass { ... }

36.Which browsers support CSS?

A.* 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

37.How do I combine multiple sheets into one?

A.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.: <LINK REL=Stylesheet HREF="default.css" TITLE="combined"> <LINK REL=Stylesheet HREF="fonts.css" TITLE="combined"> <LINK REL=Stylesheet HREF="tables.css" TITLE="combined">

38.How can you specify background images?

A.body { background-image:url(example.gif) ; }

39.How do I have a fixed (non-scrolling) background image?

A.body { background-image: url(example.gif); background-attachment:fixed; }

40.How do I eliminate the blue border around linked images?

A.a img { border: none ; }

41.Can CSS be used with other than HTML documents?

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

42.Can Style Sheets and HTML stylistic elements be used in the same document?

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

43.What is selector?

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

44.What is cascade?

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

45.How do I have a non-tiling (non-repeating) background image?

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

46.How do I make my div 100% height?

A.body, html { height:100%; }

47.What is property?

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

48.Can I include comments in my Style Sheet?

A.Yes. Comments can be written anywhere where whitespace is allowed and are treated as white space themselves. Anything written between /* and */ is treated as a comment (white space). NOTE: Comments cannot be nested.

49.How to use CSS building a standards based HTML template?

A.It should: 1. Contain: header, navigation, content, footer 2. Use well-structured HTML 3. Be error-free and encourage good coding

50.How To Style Forms?

A.Forms and form elements like SELECT, INPUT etc. can be styled with CSS - partially. Checkboxes and Radiobuttons do not yet accept styles, and Netscape 4.xx has certain issues, but here is a tutorial that explains the application of CSS Styles on Form Elements.

51.Can I attach more than one declaration to a selector?

A.Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list, e.g.; Selector {declaration1; declaration2} P {background: white; color: black}

52.Border around a table?

A..tblboda { border-width: 1px; border-style: solid; border-color: #CCCCCC; } <div class="tblboda"> <table yaddayadda> <tr> <td>Content text and more content</td> </tr> </table> </div>

53.How do I centre my page?

A.#wrap { position:relative; width:780px;height:100%; margin:auto; }

54.Justified Text?

A.p {text-align: justify;}

55.How do you override the underlining of hyperlinks?

A.CSS has the ability to explicitly control the status of underlining for an element - even for hyperlinks. The correct way to do this in an external or document-level style sheet is: A { text-decoration: none } and within an anchor element as: <a HREF="example.htm" STYLE="text-decoration: none">link text</a>

56.How can we write margin and padding format in css code?

A.Margin : top right bottom left, Padding : top right bottom left

57.What is the difference between css2 and css3?

A.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. - See more at: http://thestudentdaily.com/2011/12/css-interview-questions-and-answers-for-freshers/1055/#sthash.4cm37epK.dpuf

58.What is the default margin and padding of h1,h2,h3,h4,h5,h6?

A.heading 1 (h1) margin-left: 0px margin-right: 0px; margin-top: 8px; margin-bottom: 8px; heading 2 (h2) margin-left: 0px margin-right: 0px; margin-top: 10px; margin-bottom: 10px; heading 3 (h3) margin-left: 0px margin-right: 0px; margin-top: 12px; margin-bottom: 12px; heading 4 (h4) margin-left: 0px margin-right: 0px; margin-top: 16px; margin-bottom: 16px; heading 5 (h5) margin-left: 0px margin-right: 0px; margin-top: 20px; margin-bottom: 20px; heading 6 (h6) margin-left: 0px margin-right: 0px; margin-top: 28px; margin-bottom: 28px;

59.Can I attach more than one declaration to a selector?

A.Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list, e.g.; Selector {declaration1; declaration2} P {background: white; color: black}

60.What is the correct CSS syntax for making all the elements bold?

A.span {font-weight:bold}

61. How do you add a comment in a CSS file?

A./* this is a comment */

62.What property is used to change the text color of an element?

A.color:

63.The # symbol specifies that the selector is?

A.id

64. Which snippet of CSS is commonly used to center a website horizontally?

A.margin: 0 auto;

65. How do you make a list not display bullet points?

A.list-style-type: none

66. What is the correct Syntax for importing a stylesheet in CSS?

A.@import url(css/example.css);

67.How do you make each word in a text start with a capital letter?

A.text-transform:capitalize

68.the property specifies the stack order of an element?

A.z-index

69.What is a class?

A.A class is a style (i.e., a group of CSS attributes) that can be applied to one or more HTML elements. This means it can apply to instances of the same element or instances of different elements to which the same style can be attached. Classes are defined in CSS using a period followed by the class name. It is applied to an HTML element via the class attribute and the class name.

70.What is contextual selector?

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

71.What is grouping?

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

72.What are child selectors?

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

73. What is CSS rule at-rule?

A.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 to z, A to Z, digits 0 to 9, dashes and escaped characters, e.g. @import or @font-face.

74.What is "important" declaration?

A.Important declaration is a declaration with increased weight. Declaration with increased weight will override declarations with normal weight. If both readers and authors style sheet contain statements with important declarations the authors declaration will override the readers. BODY {background: white ! important; color: black} In the example above the background property has increased weight while the color property has normal.

75.To what are partial URLs relative?

A.Partial URLs are relative to the source of the style sheet. The style sheet source can either be linked or embedded. To which source partial URLs are relative to depends on their occurrence. If a partial URL occurs in a linked style sheet then it is relative to the linked style sheet. The URL of the linked style sheet is the URL of the directory where the sheet is kept. If a partial URL occurs in an embedded style sheet then it is relative to the embedded style sheet. The URL of the embedded style sheet is the URL of the HTML document in which the sheet is embedded.

76.What is Extensible Stylesheet Language (XSL)?

A.XSL is a proposed styling language for formatting XML (eXtensible Markup Language) documents. The proposal was submitted to the W3C by Microsoft, Inso, and ArborText.

77.What are different ways to integrate a CSS into a Web page?

A.There are three ways to integrate CSS into a Web page Inline: HTML elements may have CSS applied to them via the STYLE attribute, Embedded: By placing the code in a STYLE element within the HEAD element, and Linked/ Imported: Place the CSS in an external file and link it via a link element.

78.What is Tweening?

A.It is the short form for in-betweening and it is the process of generating intermediate frames between two images.

79.Explain RWD?

A.RWD is the abbreviation for Responsive web design. In this technique, the designed page is perfectly displayed on every screen size and device, be it desktop, mobile, laptop or any other device. You dont need to create a different page for each device.

80.What is the difference between CSS and CSS3 ?

A.CSS3 is upgreaded version of CSS with new future like Selectors,Box Model, Backgrounds and Borders, Text Effects,2D/3D Transformations, Animations, Multiple Column Layout,User Interface etc.

81.If background and color should always be set together , why do they exists as seperate properties?

A.There are several reasons for this, First, style sheets become more legiable both for humans and machines. The background property is already the most cmplex property in CSS1 and combining it with color would make it even more complex. Second, color inherits, but background doesnt and this would be a source of confusion.

82.Describe hover element?

A.A hover element is activated if the user moves pointer on the area in which HTML code is defined. Mainly, this style is used for online advertising. It can be appended to #elementid:hover.

83.What is the main aim of applying style sheets?

A.The main use of style sheet is to ensure great degree of control on his presentation to the user. If the user does not like some font then he can modify it without any difficulty. The effects of browser on the application or text part of a web page are minimized by the developer. Control on the complete web page without external influences, isolation of page from code part of HTML.

84.Describe CSS filter?

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

85.Describe internet explorer box model bug?

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

86.Describe vertical control limitation?

A.Vertical control limitations are always considered as a nightmare for the designers. Horizontal positioning of element or text is easy but vertical positioning the element leads to impossible and complex tasks. For vertical placements of elements, CSS has unsupported rules.

87.Describe absence of expressions?

A.Currently, CSS does not have ability to state property values as simple expressions. Example: if you are interested in calculating size of all columns but there is restriction on sum of all columns. This issue is solved by most of the browsers by proprietary expressions which do a good job.

88.Describe lack of orthogonality?

A.Various jobs are explained by lack of orthogonality which is used many times for same job or undefined correctly for particular application. CSS defines that there are no margins in the internal elements of a table so it is better to use border spacing which may lead to confusion.

89.Describe ease of maintenance with CSS?

A.A good style sheet has effective use of cascading style sheets and inheritance. If there is any change to a single element of global style sheet then all the elements on the web page are changed. Thus, maintenance is made easy as the style of entire page is changed by making modifications to single element.

90.Describe float containment?

A.Float elements are not supported by CSS because it results in overflow. Float also varies according to the size and resolution of web browser whereas positions do not. There are various properties which are defined about float but they have own restrictions.

91.What is Css Hack Code for ie8, ie7?

A.Css hack code for ie8 is 9 Ex: .class{ padding-top:10px9;} : It effects only in ie8 browser Css hack code for ie7 is *+html Ex: *+html .class{ padding-top:10px;} : It effects only in ie8 browser

92.What is shorthand property?

A.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 property font .

93. Can I attach more than one declaration to a selector?

A.Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list.

94.What are the issues encountered with IE z-index?

A.z-index is used to show the order of the object

95.Which set of definitions, HTML attributes or CSS properties, take precedence?

A.CSS properties take precedence over HTML attributes. If both are specified, HTML attributes will be displayed in browsers without CSS support but won't have any effect in browsers with CSS support.

96.Why call the subtended angle a pixel, instead of something else?

A.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 3�3 device pixels to avoid printing illegibly small text and images. I dont recall anyone ever proposing another name for it. Subangle? Personally, I think most people would prefer the pragmatic �px� to the non-intuitive �sa�.

97.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?

A.It makes sense in some situations, but not in others. For example, when a child element 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.

98.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?

A.It makes sense in some situations, but not in others. For example, when a child element 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.

99.What is contextual selector?

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

100.Define cascading style sheets?

A.A designer makes use of cascading style sheets in different ways. Mainly, it helps in designing style sheets for HTML and content pages. It is applicable to any markup language or XML document.

101.Describe features of CSS?

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

102.Describe the rules in style sheets?

A.In style sheets, a big list of rules is defined. Every rule contains declaration block and selectors. Declaration block contains declarations which are defined and separated using semicolon in curly braces. Additionally, every declaration has a property, colon and a semicolon.

103.Describe hover element?

A.A hover element is activated if the user moves pointer on the area in which HTML code is defined. Mainly, this style is used for online advertising. It can be appended to #elementid:hover.

104.Give some uses of CSS?

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

104.Explain different types of author styles?

A.A developer, web page author, designer, etc describe styles in various forms they are:
• Embedded style
• External style sheets and
• Local and default style sheet
• Inline styles

105.What is the main aim of applying style sheets?

A.The main use of style sheet is to ensure great degree of control on his presentation to the user. If the user does not like some font then he can modify it without any difficulty. The effects of browser on the application or text part of a web page are minimized by the developer. Control on the complete web page without external influences, isolation of page from code part of HTML.

106.Describe CSS1?

A.The adoption of W3C is recommended in the year 1996. Some of the features and capabilities of CSS1 are given below:
• Text colors, background colors, etc
• Font properties
• Images, table’s alignment
• Spacing between words, text, etc
• Margin, border, positioning and padding of elements
• Attributes are identified uniquely and generally classified.
The specifications present in CSS1 are adopted by W3C.

107.Give the extra features in CSS2 compared to CSS1?

A.There are many features in CSS2 and some of them are given below:
• Elements positioning will be according to fixed, relative and absolute positioning.
• Large number of media functions is added.
• Bidirectional, shadows support for aural and text style sheet.

108.Describe CSS filter?

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

109.Describe internet explorer box model bug?

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

110.Describe vertical control limitation?

A.Vertical control limitations are always considered as a nightmare for the designers. Horizontal positioning of element or text is easy but vertical positioning the element leads to impossible and complex tasks. For vertical placements of elements, CSS has unsupported rules. 

111.Describe absence of expressions?

A.Currently, CSS does not have ability to state property values as simple expressions. Example: if you are interested in calculating size of all columns but there is restriction on sum of all columns. This issue is solved by most of the browsers by proprietary expressions which do a good job.

112.Describe lack of orthogonality?

A.Various jobs are explained by lack of orthogonality which is used many times for same job or undefined correctly for particular application. CSS defines that there are no margins in the internal elements of a table so it is better to use border spacing which may lead to confusion. 

113.Describe ease of maintenance with CSS?

A.A good style sheet has effective use of cascading style sheets and inheritance. If there is any change to a single element of global style sheet then all the elements on the web page are changed. Thus, maintenance is made easy as the style of entire page is changed by making modifications to single element.

114.Describe float containment?

A.Float elements are not supported by CSS because it results in overflow. Float also varies according to the size and resolution of web browser whereas positions do not. There are various properties which are defined about float but they have own restrictions.

115.Give the limitations of style sheets?

A.Style sheets have own limitations and some of them are given below:
• Vertical control limitations
• Inconsistent browser support
• Some of the limitations present in CSS are lack of column declaration and variables.
• Float containment, margin collapsing, control of element shapes, etc.

116.What are different ways to integrate a CSS into a Web page?

A.There are three ways to integrate CSS into a Web page

a.) Inline: HTML elements may have CSS applied to them via the STYLE attribute.
b.) Embedded: By placing the code in a STYLE element within the HEAD element.
c.) Linked/ Imported: Place the CSS in an external file and link it via a link element.

117.If background and colour should always be set together, why do they exist as separate properties?

A.The reasons for this are as follows:
- It increases the legibility of the style sheets. The background property is a complex property in CSS. If it is combined with color, the complexity will further increase.
- Color is inherited, but background isn’t. This can further increase the confusion.















Comments