Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to negate a selector not(first-child) #1833

Closed
kiga01 opened this issue Sep 11, 2015 · 2 comments
Closed

how to negate a selector not(first-child) #1833

kiga01 opened this issue Sep 11, 2015 · 2 comments

Comments

@kiga01
Copy link

kiga01 commented Sep 11, 2015

guys i'm trying to get a rule that only a apply to all the selectors of a class without the first element

for example .column:not(first-child)

how can i do something like this with sass?

thank u

@alexandradeas
Copy link

You would simply use the css pseudo-selectors and write .column:not(:first-child) - note that you missed the semi-colon on :first-child - however, I'd personally advise against chaining pseudo-selectors as legacy browsers have trouble supporting them in my experience.

A better alternative would be to simply create .column and apply your styles then simply overwrite .column:first-child to apply your styles to the first child. This will give you a faster rendering time and greater cross-browser consistency.

@chriseppstein
Copy link

Sorry, our issue tracker is not for general support of how to write CSS. Please seek support in a more appropriate forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants