• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic