Saturday, August 11, 2012

Can I include comments in my Style Sheet?

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.

Monday, May 28, 2012

How do I combine multiple sheets into one ?



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">




Saturday, May 19, 2012

Which browsers support CSS? 



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.


What is imported Style Sheet? How to link? 


Imported Style Sheet is a sheet that can be imported to (combined with) another sheet. This allows creating one main sheet containing declarations that apply to the whole site and partial sheets containing declarations that apply to specific elements (or documents) that may require additional styling. By importing partial sheets to the main sheet a number of sources can be combined into one.
To import a style sheet or style sheets include the @import notation or notations in the STYLE element. The @import notations must come before any other declaration. If more than one sheet is imported they will cascade in order they are imported - the last imported sheet will override the next last; the next last will override the second last, and so on. If the imported style is in conflict with the rules declared in the main sheet then it will be overridden.

<LINK REL=STYLESHEET HREF="main.css" TYPE="text/css">
<STYLE TYPE="text=css">
<!--
@import url(http://www.and.so.on.partial1.css);
@import url(http://www.and.so.on.partial2.css);
.... other statements
-->
</STYLE>

Friday, May 18, 2012



What is external Style Sheet? How to link? 


External Style Sheet is a template/document/file containing style information which can be linked with any number of HTML documents. This is a very convenient way of formatting the entire site as well as restyling it by editing just one file. The file is linked with HTML documents via the LINK element inside the HEAD element. Files containing style information must have extension .css, 
e.g. 
style.css.
 <HEAD> 
<LINK REL=STYLESHEET HREF="style.css" TYPE="text/css">
 </HEAD> 

Thursday, March 22, 2012

ID & Class

For setting the HTML style CSS is provide "id"  &  "class" to define your styles in SELECTOR section .


The ID 


1. The id is used to specify a style for a unique element.

2. The id uses the id attribute of the HTML element, and is defined with a "#".

example:-

#style
{
text-align:center;
color:red;
} 



The class Selector

Class is used to specify a style for group of element

1. This is used to style for many HTML element with the same class.

2. The class selector is defined as ".".

example :


p.center {text-align:center;} 



Friday, March 16, 2012

The CSS rule has two main part that is SELECTOR and the second is DECLARATION.

p {color:red;text-align:center;} 

in this code 
  • P is Selector 
  • color & text is declaration

.



Starting with CSS

The CSS is stands for "Cascading Style Sheet ".
Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!