/    Sign up×
Community /Pin to ProfileBookmark

Inheriting?

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.

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@pyroDec 12.2003 — 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.
Copy linkTweet thisAlerts:
@SulauthorDec 12.2003 — 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?
Copy linkTweet thisAlerts:
@toicontienDec 13.2003 — It could be something like this:
<i>
</i>&lt;style type="text/css"&gt;
&lt;!--
.class1, .class2 {
color: red;
}

.class2 {
font-weight: normal;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 class="class1"&gt;This text is red and boldface.&lt;/h1&gt;
&lt;h1 class="class2"&gt;This text is red, but not boldface. It has properties of both class1 and class2.&lt;/h1&gt;
&lt;/body&gt;

Is that what you're aiming for?
Copy linkTweet thisAlerts:
@SulauthorDec 13.2003 — Yes, something like that, I'm going to try it out and see.
×

Success!

Help @Sul spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...