In somehow, any web developer or webmaster should ever faced with the CSS (Cascading Style Sheets).It styles the elements of HTML.A newbie interface developer is always get confused about the difference between ‘css id’ and ‘css class’.IDs are defined as # mark, and classes are defined . (dot) in all versions of CSS.
#ID: They are unique definitions and has to be used once in HTML file.If it is used twice or more, page will give markup error.IDs are usually used in main parts of the layouts such as header,container and footer.
.CLASS: Classes are able to be used more than one in a web page without any markup errors.They are usually used in sub elements of IDs.
An example usage:
#header {
width: 100%;
height:50px;
margin:0;
}
.bannerone {
width:468px;
height:60px;
display:block;
}
As you can see, we can repeat .bannerone class as much as we want.
If you are new on web developing then you will understand the difference asap.

recent comments