I searched many times but still cant understand the difference between div and class use in css Please any one tell my easy and effective way?
in the .CSS file you put .name when you use class and #name when you use ID. I don't think there's any difference in the way of using them. I use class when I code with tables and if when I code with div's.
There are very important differences. A class token points to any number of elements within a group. It's like saying everyone with blue eyes. In a practical sense, you might have a class called 'comment' on your blog page. You can style the <element class="comment"> and its descendants as a contextual block. You might want to make the text green without affecting other parts of the page. Simply style .comment p {color: green;}. The id token points only to one element. Like calling someone by name; only that one person answers. It is highly specific. When the style engine walks the DOM, it stops as soon as it finds its first instance of the id; since there can be only one, the style rules cannot be applied to any subsequent instances. Every class instance is located and styled. The real power of the id shows up when scripting against the DOM. You can use document.getElementById("token"), and your script knows exactly which element it is. There is no counterpart for classes. You must walk the DOM, searching for an element where element.class == "token". When you find one, it is just a member of an array of any number of elements with that class. Help some? cheers, gary
i've been thinking of this before, there's a big diffrence between ID and Class but i don't have time to know it, so thank you very much for this.
Your page won't validate, javascript may have problems and using the http://url.com#anchor won't work. It's not meant to be used more than once.