/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Id predomminance over class

Hi!

I have a layout for a site, with a little different Layout2.
Like this:

[CODE]
#Main {
margin: 10px;
float: left;
width: 427px;
position: relative;
z-index: 2;
background-color: #F8FAE8;
min-height: 250px;
}
#Main .Lay2 {
width: 650px;
}
[/CODE]

The #Main .Lay2 doesn’t seem to take effect. Is it overridden because it’s a class vs. an id?
Any solution other than making another stylsheet specific for the Layou2 and setting #Main to the desired width?

Thanks!

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 30.2009 — You make a confusion.

#Main .Lay2

That means the class Lay2 of [I]the elements nested inside[/I] the element with the id="Main". If you need the element with the id="main" [I]and[/I] the class="Lay2" you should have written:

#Main.Lay2

Note the white space or the absence of the white space between the selectors
Copy linkTweet thisAlerts:
@G-SunauthorJul 30.2009 — Oh.. thanks! I didn't know it was any difference.

Works now. Thanks!
×

Success!

Help @G-Sun 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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