Solved

CSS Class Names and proper identification

Posted on 2012-04-11
3
177 Views
Last Modified: 2012-04-30
Hi -

We have a website where the HTML is being generated from the CMS system.  As such - the class names for various parts are predictable.

For example - we have a menu where the menu options are along the lines of:

<li class="leaf">
<a href="#">First menu item</a>
</li>
<li class="leaf">
<a href="#">Second menu item</a>
</li>
<li class="leaf last">
<a href="#">Last menu item</a>
</li>

What would the CSS line be to identify anything with "leaf" and "a"?

Sort of a generic..

.leaf a { }

?
0
Comment
Question by:erzoolander
  • 2
3 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 37832930
That would work.

You could also do li.leaf a{}
0
 
LVL 1

Author Comment

by:erzoolander
ID: 37833001
And that would cover the "leaf last" classname as well?
0
 
LVL 30

Accepted Solution

by:
LZ1 earned 500 total points
ID: 37833006
If you want to do both leaf and last classes then do this:

li.leaf.last a{}

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question