Hi
I'm defining my font properties for normal text on a style sheet, and now I want to define my font properties for a title/heading text. Is there a way that I can inherit the properties of the normal text, and then add on extra properties (some of which that over-ride the normal text properties)?
Thanks.If you define the text propreties for the html or body elements (or any other element that the child elements are contained in) the inheritance will be automatic.I don't really want to define html elements, so I've created two classes, and I want one to inherit from the other. How do I do this?It could be something like this:
<style type="text/css">
<!--
.class1, .class2 {
color: red;
}
.class2 {
font-weight: normal;
}
-->
</style>
</head>
<body>
<h1 class="class1">This text is red and boldface.</h1>
<h1 class="class2">This text is red, but not boldface. It has properties of both class1 and class2.</h1>
</body>
Is that what you're aiming for?Yes, something like that, I'm going to try it out and see.
I'm defining my font properties for normal text on a style sheet, and now I want to define my font properties for a title/heading text. Is there a way that I can inherit the properties of the normal text, and then add on extra properties (some of which that over-ride the normal text properties)?
Thanks.If you define the text propreties for the html or body elements (or any other element that the child elements are contained in) the inheritance will be automatic.I don't really want to define html elements, so I've created two classes, and I want one to inherit from the other. How do I do this?It could be something like this:
<style type="text/css">
<!--
.class1, .class2 {
color: red;
}
.class2 {
font-weight: normal;
}
-->
</style>
</head>
<body>
<h1 class="class1">This text is red and boldface.</h1>
<h1 class="class2">This text is red, but not boldface. It has properties of both class1 and class2.</h1>
</body>
Is that what you're aiming for?Yes, something like that, I'm going to try it out and see.