1

I have several css files in a theme info file. Suppose i have two definitions of h2 in different files? How to configured the files so I manage to get the h2 definion I want?


I edited the question as I do not get a solution yet. The question refered as an answer is problaby one of the reasons. So I first set the order of the files oke. They are now oke. Other changes are reflected.

So specific.... I now have two H2 definitions in 1 css file.

h2 {
    font-size: 19px;
}

and

.page-shop .view-header h2 {
    font-size: 100px !important;
}

But still the first is applied in the shop page..

Any suggestion?

For everybody who is reading this; I found my solution:

I'm using Sublime Text editor for css styling. As everything in the syntax had the good color I thought the file is build up good. But in some try and error I saw one line like below:

form-item ( font-size: 10em;}

Note that instead of openening with a { it is opening with a (

And because of this the rest of the css file is not processed well.

2

1 Answer 1

3

The CSS files are processed in order, so if your .info file looks like this:

stylesheets[all][] = css/foo.css
stylesheets[all][] = css/bar.css

Then the styles from foo.css will be included before those from bar.css. The same applies whether each CSS file is included separately, or whether they're aggregated.

If you're still unsure which rule will be applied at that point, you need to read up on CSS specificity, as Drupal doesn't affect it.

4
  • Oke thxs. I did this. The problem I'm looking into is that no changes in the css are reflected in the site... I do not understand why...
    – Justme
    Jun 20, 2016 at 9:36
  • @Justme "flush caches" and check again, also make sure that your theme is enabled.
    – mchar
    Jun 20, 2016 at 9:39
  • If this was the solution I did not spend already 2 hours on this :-)
    – Justme
    Jun 20, 2016 at 9:41
  • solved css thing by install devel module and enable rebuild theme on every load. Do not understand why clear caches is not do the same, anyhow up and runing again.
    – Justme
    Jun 20, 2016 at 9:50

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.