2

I have two css files having the following class definition

default.css ( Loaded First )

#order-standard_cart .products .product header {
    background: #f8f8f8 none repeat scroll 0 0;
    border-radius: 3px 3px 0 0;
    margin: 0 1px;
    padding: 10px 20px;
    position: relative;
}

custom.css ( Loaded 2nd )

#order-standard_cart .products .product header {
    background: #7EBBF3 none repeat scroll 0 0;
}

Even after loading second, the background property is not getting applied on any of the browsers and only the first CSS file is being applied.

CSS File Import

Firebug CSS Output

8
  • Please provide a link to the website. Commented Jan 29, 2017 at 17:48
  • Added in the main post Commented Jan 29, 2017 at 17:53
  • Can you create a minimal reproducible example that demonstrates the issue? Preferably as a snippet here in the question. The website itself contains too many elements and styles to pinpoint the problem, and besides, since you're currently working on it, it may soon no longer match the problem description in the question. In addition, creating a minimal reproducible example may well help you solve the case yourself. Commented Jan 29, 2017 at 18:07
  • 2
    line 213 in your html code overrides your custom styles. Commented Jan 29, 2017 at 18:14
  • Yes, the offending line is indeed in a later stylesheet than the one you think it is in. @Banzay, why not post that as an answer? Commented Jan 29, 2017 at 18:16

2 Answers 2

1

line 213 in your html code overrides your custom styles

at the header of page file all.css is loaded from payments/templates/six/css/ relative path

line 213 loads file all.css from /payments/templates/orderforms/standard_cart/css/

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

1 Comment

Yup! I see it. Thanks a lot :)
1

You include the file all.min.css?v=6235b7 a second time on line 213 and thus the selector from this file has greater priority and overwrite the selector from custom.css

2 Comments

Thanks a lot for your help, but @Banzay provided the solution first so his answer was accepted :)
I lost a few seconds because I tried to provide you with a printscreen then changed my mind.

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.