about me

For more than 6 years of experience , I have been designing user friendly websites and develop websites with the latest technology resources.I am blessed with the power of xhtml,css,php,jquery and adobe products. you can write me through hello {_at_} burakson.com

latest tweets

Follow me on Twitter

Copyright

This beautiful clean theme was created by Orman Clark.Burak Son is the responsible for any content included in this blog.Guests may use and distribute materials on their own risk.
whyids

Why IDs Instead of Classes in CSS ?

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.

Related Posts

Leave a Comment

Connect with Facebook