467,115 Members | 1,310 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,115 developers. It's quick & easy.

CSS: Any way to inherit or duplicate this class?

I've just written a CSS/HTML flyout menu as an addition to an existing system (EQdkp Plus, to be specific). The menu is generated by a couple PHP functions. The output is an unordered list as in this pseudocode:
Expand|Select|Wrap|Line Numbers
  1. <div class="menu">
  2. <ul>
  3.   <li>Entry
  4.     <ul>
  5.       <li>Submenu Entry</li>
  6.     </ul>
  7.   </li>
  8. </ul>
  9. </div>
I want to add submenu headings to my list, which is quite simple:
Expand|Select|Wrap|Line Numbers
  1. stuff
  2. <li class="menuheading">Submenu Heading</li>
  3. <li>Submenu Entry</li>
  4. stuff
However, I want to make the headings have the same visual style as the style template that's currently in use by the system. This is where my problem lies. Every style template defines its menu headings like this:
Expand|Select|Wrap|Line Numbers
  1. th.smalltitle {
  2.   font-weight: something;
  3.   color: something;
  4.   background-color: something;
  5.   more stuff
  6. }
I wish it was just .smalltitle instead of th.smalltitle; then I'd be able to simply write <li class="menuheading smalltitle">. And due to some limitations with both the system and HTML/CSS, I cannot use tables inside the menu. So, I need some way to inherit or copy the smalltitle class, like saying
Expand|Select|Wrap|Line Numbers
  1. li.menuheading inherits th.smalltitle
Is there any way to do this?
Jan 20 '08 #1
  • viewed: 7243
Share:
3 Replies
drhowarddrfine
Expert 4TB
I guess you are saying you don't have access to the CSS file? Otherwise you could just do:
.menuheading, th.menuheading{
the css
}

Or, do inline styling:
<li style="css stuff">
Jan 21 '08 #2
I guess you are saying you don't have access to the CSS file? Otherwise you could just do:
.menuheading, th.menuheading{
the css
}

Or, do inline styling:
<li style="css stuff">
Right. I want to make the style match the one defined in the current style's CSS. There may be any number of styles and they're based on a CSS template that I can't change, which has the th.smalltitle block that I mentioned. Suppose I don't know what values are used, just the names of the attributes that are set.
Jan 21 '08 #3
drhowarddrfine
Expert 4TB
Then I can't think of any way to do it. Perhaps javascript could read the values and change them using the DOM, but that's javascript
Jan 21 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by David Beardsley | last post: by
2 posts views Thread by Nathan | last post: by
6 posts views Thread by Luke | last post: by
7 posts views Thread by Steven (remove wax and invalid for reply) | last post: by
7 posts views Thread by Frank | last post: by
4 posts views Thread by bissatch@yahoo.co.uk | last post: by
5 posts views Thread by Ikke | last post: by
32 posts views Thread by Simon Dean | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.