Hey there,
I'm not sure what you're trying to do (the details) but yeah in theory assigning a class to your ul will allow you to style all the instances of unordered lists that inherit that class. I'm not sure why you have a.nav and a.nav1 - are you styling the hyperlinks (a tags) in your list? If so, you should use this markup to identify the a tags within that ul class:
Code:
ul.nav li a { css for all links in ul nav class goes here }
ul.nav1 li a {css for all links in ul nav1 class goes here }
ul.nav li a:hover { css for all link mousehovesr in the nav class ul goes here e.g: text-decoration: underline; }
This is because your links within the unordered list will always be in a <li></li> (list item) tag (or should be, rather). So the <a> tag is within the <li> tag which is within the <ul> tag. The same goes for any other styling:
Code:
ul.nav li { font-weight: bold; color: Red; }
ul.nav li { color: Blue; }
you can even use a custom background image to replace the standard HTML list icons:
Code:
ul.nav { list-style: none; padding: 0; }
ul.nav li {background-image:url( urltoimage ); }
Finally, there is a quicker way. It all comes down to how "generalizing" you are, or how specific your css attributes need to be. For example if all the <ul> classes on the page share some attributes, you could easily define a CSS rule for all the <ul> classes - because of the way CSS "inherits" and overwrites styling, you could then specify only the unique attributes in the ul.nav and ul.nav1 class stylings, and the rest they would inherit from the general unordered list class (which in turn, you can also overwrite to suit your needs by simply creating .ul { cssrules } ).
Hope that helps! or did I misunderstand what you are attempting?
Bookmarks