CSS selector problem ... built in ASP

G

Griff

Hi

I have the following html structure

<div>
<ul>
<li>
<a href="...">I'm a level 1 link</a>
<ul>
<li>
<a href="...">I'm a level 2 link</a>
<li>
</ul>
</li>
</ul>
</div>

I want to have a web application that allows the end user to build up their
style sheet by selecting colours etc and seeing what affect this has on the
above html.

So, someone might want level 1 links to appear one way and level 2 links to
appear another.

How this happens is as follows:

They select a colour for each and these values get sent to the page
containing the above html as parameters within the request object.

The style sheet is then built up as follows (using ASP)

div ul li a
{
property: <% = Request("level1colour")%>;
}

div ul li ul li a
{
property: <% = Request("level2colour")%>;
}

This works perfectly (I'm writing the code from scratch in this post, so
there may be errors in what's written here).

However, if they do NOT provide a level two colour, then the level 2 links
inherit the level 1 properties.

Effectively, I believe that what this style sheet is saying is "any anchors
in a list item in an unordered list anywhere in a div will have a level1
colour, unless these are nested within a further list item & unordered list
in which case they will have the level2 colour".

I need to find a way of saying that the level 2 link will not inherit the
level 1 properties.

Any suggestions on how this can be done with CSS?

Thanks

Griff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top