Arif's writing

Just trying to give by write something worthwhile to others..

Sunday

Difference between "id" and "class"

(Image:Screenshot of tizag.com page)
Both terms are used to create custom CSS, that applied to HTML tags, but there are differences between "class" and "id".

We can use either the attributes "id" and "class" to apply CSS styles to page elements, but :
1. id only applied to a single object: it can't be two same id(s) in a page.
2. class can be used for more objects (identical or not).

For example, it is possible to have this code :
<div class="author"></div> <div class="author"></div>
But it is not possible to have this code :
<div id ="author"></div> <div id ="author"></div> 
Then, for what was id attribute made?

By the way, what is the reason of "id" can only be used once on a page? while "class" can be used several times, and has the same function with "id"?  There are several reasons for this, here are :

1. Javascript function getElementById using the id attribute to get or fetch the content inside of its id.
2. The id can be used as name anchor, as it allows to replace (for this feature) the attribute "name" of <a tag. For example :
<div id="header">... <a href="#header">Top of page</a>

Labels:

Tuesday

What are the criteria of a good website design?

(Image:Teresa Albor / USAID)
these days number of visits to my website has declined, while I asked my friend about it, he said my site has a problem in its design. Therefore, I would like to ask what are the design criteria of good website for visitors? and what should I do? thank you - Kadek Rai

Actually, there are no specific criteria for a good website design. So I would just give you an advice about the general criteria of good design. First, the load time, the shorter loading time, it is better. So, here is a summary of something that you should do to your site (especially, your design):
1. Minimize the use of animations, images, and javascript on your site.
2. Use an HTML compressor to shrink the size of the html file that you've created.
3. See more about the user's behavior of your site with Google Analytics

About what I found on www.7sisters.com. There I read about the the important points of a good website design, which is:
1. Accessibility
2. Compatibility
3. Convenience
4. Efficiency
5. Functionality
6. Legibility
7. Navigability
8. Originality
9. Typography

For further details, you can read on www.7sisters.com

Labels: