473,626 Members | 3,675 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS: Any way to inherit or duplicate this class?

2 New Member
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="menuhead ing 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
3 7505
drhowarddrfine
7,435 Recognized Expert Expert
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
Clownboat
2 New Member
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
7,435 Recognized Expert Expert
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

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

Similar topics

8
4590
by: David Beardsley | last post by:
Is there no way to refer to an existing rule to set a value for a new rule short of generating a style sheet server side? For example: div.a {color: blue;} div.b {color: div.a.color} Without this type of mechanism you end up duplicating values. I usually try to avoid duplicating data because it creates maintenance
2
10362
by: Nathan | last post by:
We have a content management system which allows our users to enter html into pages on the site but they often just paste in from Word and fill the site with word and html tags. Our content management system will attempt to clean the code but leaves some tags like the font tag untouched. Ideally the management system would allow us to filter all tags we don't want out. But is there anything in CSS which may also help to override font...
6
8824
by: Luke | last post by:
Hi, Is it possible to do this... ..MyStyle{ color: White; font-family: Verdana; font-size: 10px; background-color: Blue;
7
1775
by: Steven (remove wax and invalid for reply) | last post by:
I'm moving an old page to a new host, and trying to modernize it at the same time. There are two little problems that are driving me nuts. 1. Validation of www.marzolian.com/index.html says: Line 33, column 5: element "NOTE" undefined <note>Last revised: May 29, 2005</note> "You have used the element named above in your document, but the document type you are using does not define an element of that name."
7
1751
by: Frank | last post by:
Hi, a question probably asked before, but I can't find the answers. Base class X, classes A, B and C inherit class X. In class A I do not want to inherit property (or function or method) P1. Possible? How? Thanks in advance Frank
4
38853
by: bissatch | last post by:
Hi, I would like to be able to create a CSS class that has all the same property values as another class but additional ones too. Instead of having to rewrite the same property values again, can I simply request that the second class inherits all the values from the first one and then only have to write the additional properties. For example: ..fancyTable { border-top: 1px solid #000;
5
1591
by: Ikke | last post by:
Hi everybody, Here's a little problem that's been bothering me. I have a stylesheet, in which I define the looks of a table on my website. Each alternating row gets a different color, as is usually done on most websites. This means that each alternating <trgets an extra class="alt" attribute - no problems so far. After validating my CSS, however, I found that I still had three errors
32
2719
by: Simon Dean | last post by:
Duh... Not another one... Hopefully simple though, I hate the way *I* (and it might be a CSS trait) can't intermix fixed width divisional elements with a variable auto expanding div??? The great thing I loved with Tables, was being able to say:
27
3858
by: GloStix | last post by:
WARNING VIDEO TAKES A WHILE TO LOAD http://screencast.com/t/BWQ6DNtsM I really don't know how to fix this other than putting another div. But I dont' exactly want to do that for every page. random div's everywhere Is there any other way? Also I'm trying to get a scaled thumbnail of the orginal picture WHILE maintaining the size of the css box.. Is that possible? Or do I have to scale it in Photoshop and make a separate image =\
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.