0

I'm trying to understand the css specificity. What I want to achieve is to have the basics.css to have the highest specificity so that whatever it's in there will overwrite completely the bootstrap css, even if it's the same selector.

How can I order my files here to achieve this?

@import url("common.css");
@import url("links.css");
@import url("content.css");
@import url("colours.css");
@import url("basics.css");
@import url("/bootstrap/css/bootstrap.css");
@import url("/bootstrap/css/bootstrap-responsive.css");
@import url("/bootstrap/css/bootstrap-select.min.css");
@import url("/footable/css/footable.core.min.css");
@import url("/font-awesome/css/font-awesome.css");
@import url("/iconmoon/style.css");

1 Answer 1

2

The LAST CSS overwrites the FIRST CSS called.

So, in order to do this, i would recommend you to call first the least important CSS and last the most important.

In this case, you would call first bootstrap.css and last basics.css

EDIT:
Something like this

@import url("/bootstrap/css/bootstrap.css");
@import url("/bootstrap/css/bootstrap-responsive.css");
@import url("/bootstrap/css/bootstrap-select.min.css");
@import url("/footable/css/footable.core.min.css");
@import url("/font-awesome/css/font-awesome.css");
@import url("/iconmoon/style.css");
@import url("common.css");  
@import url("links.css");
@import url("content.css");
@import url("colours.css");
@import url("basics.css");
Sign up to request clarification or add additional context in comments.

1 Comment

In this case, does order of import take precedence over traditional specificity comparisons?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.