/    Sign up×
Community /Pin to ProfileBookmark

Overrule image issue

Okay,

[code=html]
<div id=”content”>
<h1 class=”history”><span>My text</span></h1>
</div>
[/code]

and

[CSS]
#content h1{
background: url(images/h1.gif) repeat-x left top;
height:50px;
}

#content .history
{
background: url(images/historie_h1.gif) no-repeat left top;
}
[/CSS]

h1.gif is after it’s repeat-x a gray bar.
historie.gif is just an image.

So it should result in:
a gray bar with on the left on top of the gray bar the image.

But: PROBLEM!
Somehow historie.gif overrules the h1.gif resulting in showing only the historie_h1.gif!!

Why?

And is there anyother way of solving this (without using another pair of <div>’s)

Thanks.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsJan 17.2006 — the [i]#content h1[/i] selector takes over rules the [i]#content .history[/i], class selectors have lower presence (or weight) versus element selectors

besides, an element can only have one background image, thus your html should be[code=html]<div id="content">
<h1><span class="history"> My text</span></h1>
</div>[/code]
×

Success!

Help @3Pinter 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 5.24,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...