[EMAIL PROTECTED] wrote:
>>> (Should I create a class to attach to the ul?)
>> The short answer is "yes", but a better (longer) answer is you should
>> use an ID, since there's only likely to be one instance of it per page.
> 
> Thank you, so then it would be (for instance)
> 
> <ul id="sub-menu-page" class="sub-menu-page">
>      <li id="sub-menu-page" class="sub-menu-page"></li>
> </ul>
> 
> and
> 
> .sub-menu-page {
>       border: none;
>       margin-left: 0px;
>       padding-left: 0px;
>       list-style-type: none;
>       list-style-position: inside;
>       list-style-image: none;
> }  (or whatever styles I want)
> 
> and I would attach this class to both ul id="sub-menu-page"
> class="sub-menu-page" and li id="sub-menu-page" class="sub-menu-page", is this
> correct?
> 
> thanks again, kd
Well sort of.  You are using both a class and an ID.  There may be times 
when you want to, but in this instance probably not.  If there will just 
be one of these elements ever, then ID is appropriate.

So if you will only have one submenu ul, ever, then ID is the way to go 
for the UL.

But if for example you may have a couple of ul submenus (one for each 
category of menu links or something), then you want a class as there can 
be more than one use of a class.

Conversely I presume you are using a list because you want to use 
multiple li tags in it.  So you would not give an id to that li tag as 
you will have multiples,  So you almost certainly want class and not id 
for the li tag.

Then to style an id you use #elementname versus to style a class you use 
.elementname.

You may also be able to simply refer to #sub-menu-page ul li {} to 
address the li tag within the submenu li.


http://www.tizag.com/cssT/class.php
http://www.tizag.com/cssT/cssid.php
might be helpful for example.

Don
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to