?
Solved

CSS Class Names and proper identification

Posted on 2012-04-11
3
Medium Priority
?
183 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 2

Author Comment

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

Accepted Solution

by:
LZ1 earned 2000 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

This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

864 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