Good evening, How to determine which file has a higher priority than your styles. Those. if you look at the console, then who disconnects my styles with background th

Thank.

enter image description here

  • The styles tab shows the current order. Your background is overlapped by the background of the .category-1 class. - Sasha Omelchenko

2 answers 2

Priority is built in order to connect css files. The latest connection is the highest priority. And what exactly interrupts - hover over the name of the file which is in the right part of each rule sss and see the full path to the file.

  • It should be noted that the pointer also affects the priority. referencing tags / classes / identifiers (etc.) also takes precedence in defining styles, regardless of whether it was declared higher or lower. - webDev_

not only the sequence of connecting styles, but also the redefinition of the property. Ie you first wrote: background-repeat: no-repeat; background-position: center center; background-size: cover; background-color: # 333;

and then, above the cascade in the last connected file, they redefined all these properties as one - background: url ("../ images / 1.jpg");

Here is the article link to understand more clearly.

  • What I redefined on the picture is understandable. Because if the picture is absent or removed from the server, then instead of it the background will be filled with monochrome. But the problem is that my style.css is the last one connected to <head>, but somehow it somehow overrides it - Kamil NHOT
  • The @KamilNHOT background property is a short record of all those properties that now appear crossed out in the inspector. if all you need to add is a picture, then use the background-image: url() property. - Sasha Omelchenko
  • I understand what you mean. Thank ! - Kamil NHOT
  • but then, if the file is connected last, but its properties are redefined, then you need to look at the weight of the selector for which you set the style - Yuriy Chaban