Previous Message
Next Message

A basic question

Sent by David Dorward on 1 March 2005 10:10


Bob McClelland [EMAIL-REMOVED]> wrote:

> I've noticed that, quite often, some folk use classes of the type:
>                div#links {etc . . .}

That isn't a class. It is a style who's selector includes a type
selector and an id selector.

> whereas I would just use :
>                #links {etc . . .}
> So, seeing as some of those who do this are pretty darn good at it, I
> presume there is a reason for the 'div'?

Purely thinking of the end result, sticking the type selector on there
is a bad idea. It would be an odd system that uses the same id on
different types of element depending on page, and it creates more work
for the rendering engine to deal with (IIRC the Mozilla documentation
explicitly advises against using redundency in selectors).

>From a development point of view, it makes it easier to associate the
style with the document in the mind of the author if there is a
reminder of which type of element to look for when trying to match the
id.

-- 
David Dorward <http://dorward.me.uk><http://blog.dorward.me.uk>
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: