10

this line of code is for the navigation bar of Apple.com

#globalheader #globalnav[class*="nosearch"] { width:100%; } 

Somebody know what that asterisk after class means there?

3

2 Answers 2

28
#globalnav[class*="nosearch"] 

means: class contains "nosearch"


#globalnav[class^="nosearch"] 

means: class starts with "nosearch"


#globalnav[class$="nosearch"] 

means: class ends with "nosearch"


Reference: http://reference.sitepoint.com/css/css3attributeselectors

Sign up to request clarification or add additional context in comments.

2 Comments

#globalnav[class*="nosearch"] is the same as #globalnav.nosearch. Isn't it?
@Dani: Nope. The first would include any class that has the string nosearch in its name, such as boxnosearch and nosearchbutton. The second would include only the class nosearch and nothing else.
0

* is very similar to ~ but ~ matches only with space around it.

E.g.

foo bar 

but not

foo-bar 

* will match both.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.