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
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