/    Sign up×
Community /Pin to ProfileBookmark

I have a style applied in JSP as below

[code] <style>
.bb_hpList .promotionsTV[class] {
min-height:200px;
}
.bb_hpList .promotionsTV {
height:240px !important;
}
</style> [/code]

when it say .bb_hpList .promotionsTV , it means two classes bb_hpList and promotionsTV are applied to this element. what does the syntax “.bb_hpList .promotionsTV[class]” mean ?

thanks

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@nathandelaneSep 30.2009 — The syntax ".bb_hpList .promotionsTV[class]" means


An element that is contained by an element with class "bb_hpList" and itself has the class "promotionsTV".
[/quote]


An example might be:
<i>
</i>&lt;div class="bb_hpList"&gt;
&lt;div class="promotionsTV"&gt;
&lt;/div&gt;
&lt;/div&gt;


I think that [class] is redundant in this situation and so I'm not certain why its there. Another pattern that you might see is
<i>
</i>.bb_hpList.promotionsTV {
...
}


And this refers to the pattern
<i>
</i>&lt;div class="bb_hpList promotionsTV"&gt;&lt;/div&gt;
Copy linkTweet thisAlerts:
@slaughtersSep 30.2009 — When you see the square brackets attached to a class or tag name in CSS it is called an attribute selector. It will only apply the style if the element also has the attribute contained in the square brackets.

Example:

a[title] {

color : blue ;

}

.

.

<a href="blah.html">Blah</a> - will NOT be blue

<a href="blah.html" [COLOR="Red"]title[/COLOR]="something">Blah 2</a> - will be Blue

Since the second link has the attribute "title" in its anchor tag the style is applied to it. Attribute Selectors are not terribly well supported yet, so you don't see them very often. You can find more about selectors here:

http://www.webteacher.ws/2008/02/15/attribute-selectors-in-css/

How it is being used in the manishrathi example does not make sense to me at all. Anything with a class name will have the class attribute.
Copy linkTweet thisAlerts:
@nathandelaneOct 01.2009 — Haha, that's what I said -- .className[class] is redundant.
×

Success!

Help @manishrathi 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.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

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