Theodore Steiner
Theodore Steiner

Reputation: 1615

Meaning of ^ selector in tabbed nav

I have a question about a specific line of code within a tabbed-navigation example I saw.

[id^=tab]:checked + label{}

I know the code is saying, in general, if this tab is clicked, do something.

But does the ^ indicator mean look for anything with the name tab in it?

Upvotes: 0

Views: 52

Answers (2)

dippas
dippas

Reputation: 60563

This is an Attribute Selector

[id^=tab] Represents an element with an attr name of id and whose value is prefixed by "tab".

Upvotes: 2

Scott McKeand
Scott McKeand

Reputation: 540

This selects every element whose id attribute value begins with "tab"

http://www.w3schools.com/cssref/css_selectors.asp

Upvotes: 1

Related Questions