Friday 10 October 2008

#id and .class

I'm still a little confused as to which to use and when. Fortunately I'm not alone; different websites offer different advice. #id's can only be used once in a single web page whereas .class can be used several times. CSS uses <div> tags to control layout, thus for the overall structure, where each <div> has one place to be, giving each <div> an #id seems to be recommended. However if you have, for example, an area on the website with news stories, it would seem logical to create a .class .news, to give each of these a uniform format. One resource I have says that #id should be used only for identity (i.e. there should be no styles associated with an #id) and that each #id should have a .class to provide style. I hope you are as confused as I am -without wishing to cause offence to animal lovers there is an olde expression "more than one way to swing a cat" -formatting web pages makes cat rotation seem like an easy thing to do ;) As I learn more, I'll publish it either in my blog or on my good web design wiki. Nick Fernando, my course tutor has suggested I should quote sources, which is a good idea. I plan to spend a few hours next week remembering where some of this came from. After all I want to be slightly more reliable that wikipedia. For the uninitiated peer review is a mechanism used by learned journals to ensure that content is not mere fabrication or opinion. Failures do occur, cold fusion and nano-technology have both been subject to major advances later proved to be fabricated. The idea is that accepted experts in each field review articles presented for publication to ensure minimum academic standards. On the web many peer reviews are carried out by flames -which like their name implies more heat than light. Learning is a multi-stage procesess
  • Thinking you know what you're talking about
  • Being proved wrong
  • Getting confused
  • Finding the true answer
Life is a journey, not a destination -the international handbook of glib truth

No comments: