• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CSS: referencing other definitions

 
Ranch Hand
Posts: 249
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been looking high and low, and have been unable to find an answer to this. I've heard that in a css you can define a style by referring to another, for instance, you define something like this:

and if you want to then define another element, to be basically the same (for instance, you want it bold) you can refer to this, so if in the future you want to change it slightly (like the color) it is no problem.
Is it also possible to do it with redefining tags--so if you want text in a <td> and a <p> to be the same, it is no problem.
Thanks in advance.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am guessing you mean something like this:
 
Mike Firkser
Ranch Hand
Posts: 249
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not really. Maybe this will be a better example:
As most of the standard text in a page is in a table and/or a paragraph, I may want them to be the same. What I want to do is redefine the <p> and <td> tags. Is there a way to redefine the <p> tag (setting font style, etc), and in the redefinition of the <td> tag can I refer to the <p> tag so the font will be the same (in case I forget to put text in a table inside a <p> tag). This way, if I want to change the font from TimesNewRoman to Verdana, I just have to change the <p> tag.
Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic