Can I include comments in my Style Sheet? |
Yes. Comments can be written anywhere where whitespace is allowed and are treated as white space them. Anything written between /* and */ is treated as a comment (white space). |
Post/View Answer
Post comment
Cancel
Thanks for your comment.!
Write a comment(Click here) ...
|
What is a Style Sheet? |
Its also called Cascading Style Sheets or CSS. Style sheets are used to maintain standards in web pages. It give you a lot of power to define how your pages will look and allow easy to update your pages when you want to make a new design via load new style sheet onto your pages. |
Explain inline, embedded and external style sheets? |
There are three ways of inserting a style sheet: <head> <link rel='stylesheet' type='text/css' href='mystyle.css' /> </head> Internal/ Embedded Style Sheet: <head> <style type='text/css'> hr {color:sienna} p {margin-left:20px} body {background-image:url('images/back40.gif')} </style> </head> Inline Styles : <p style='color: sienna; margin-left: 20px'>this is a paragraph. </p> |
What are the advantages/disadvantages of the various style methods? |
External Style Sheets Advantages Can control styles for multiple documents at once. Classes can be created for use on multiple HTML element types in many documents. Selector and grouping methods can be used to apply styles under complex contexts. Disadvantages An extra download is required to import style information for each document.The rendering of the document may be delayed until the external style sheet is loaded.Becomes slightly unwieldy for small quantities of style definitions. Internal /Embedded Style Sheets Advantages Classes can be created for use on multiple tag types in the document.Selector and grouping methods can be used to apply styles under complex contexts.No additional downloads necessary to receive style information. Disadvantages This method can not control styles for multiple documents at once. Inline Styles Advantages Useful for small quantities of style definitions.Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods. Disadvantages Does not distance style information from content (a main goal of SGML/HTML).Can not control styles for multiple documents at once.Author can not create or control classes of elements to control multiple element types within the document.Selector grouping methods can not be used to create complex element addressing scenarios. |
Can you specify more than one css class for any HTML element? |
Yes, you can. Just provide a space between both the class names. |
What is ID selector? |
ID selector is an individually identified (named) selector. Using the ID attribute the declared style can 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 character as a numeric code, however, they cannot start with a dash or a digit. <p id="ABC">Hello World!</p> |
What is contextual selector? |
Contextual selector is a selector that addresses specific occurrence of an element. It is a string of individual selectors separated by white space, a search pattern, where only the last element in the pattern is addressed providing it matches the specified context. |
|
What is Group Selectors? |
By combining the grouping of selectors that share the same declaration and declarations that share the same selector you can apply multiple declarations to multiple selectors. This technique allows you to create compact yet powerful CSS rules. This tip combines Group Selectors with Group Declarations into one powerful technique.
|
What is css class? |
Class is a group of |
Is CSS case sensitive? |
Cascading Style Sheets (CSS) is not case sensitive. However, font families, URLs to images, and other direct references with the style sheet may be. |
|
Which set of definitions, HTML attributes or CSS properties, take precedence? |
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. |
What is the difference between ID and CLASS? |
ID identifies and sets style to one and only one occurrence of an element while class can be attached to any number of elements. ID started by hash(#) Each element can have only one ID. #eva1 {background: red; color: white} <div id="eva1"> CLASS started by dot(.) You can use the same class on multiple elements. <div id="eva2"> |