Reputation: 89
I'm using this: http://webdesignerhut.com/create-pure-css-tabs/
And are looking for a way to make sure that the tabs are marked with another colour once active. Tried the following but without any success.
[id^=tab]:checked ~ [id^=label] {
background: #08C;
color: white;
}
Upvotes: 0
Views: 269
Reputation: 17876
I recently solved a similar issue, with more complete highlighting and hover. Here's a demo and the GitHub repo.
These CSS-only tabs also have optional JavaScript jump links within each tab’s content. Using naming/numbering conventions the code is scalable (as many or few tabs as you need, etc.).
Upvotes: 0
Reputation: 579
to make active on current tab, the following might be.
.tabs li.current {
background: red;
color: #fff;
}
Upvotes: 3