Anyone have an idea? why my css is disabled and strikethrough
-
Because another media query presides over another. – Ashad Nasim Mar 17 '19 at 06:22
3 Answers
CSS values can be overwritten based on their specificity:
Specificity is a weight that is applied to a given CSS declaration, determined by the number of each selector type in the matching selector. When multiple declarations have equal specificity, the last declaration found in the CSS is applied to the element. Specificity only applies when the same element is targeted by multiple declarations. As per CSS rules, directly targeted elements will always take precedence over rules which an element inherits from its ancestor.

- 8,481
- 4
- 46
- 51
Because margin
is overwritten in the @media (max-width)
query and padding is overwritten in section#intro

- 571
- 3
- 11
-
-
1@woyman1 your padding is overwritten with `section#intro` selector because it's more specific – flppv Mar 17 '19 at 06:29
because you are more specific here about the element
and you have written the above property after this
always the latest written css peoperty and value will be picked by the browser
now. you either be more specific or use !important property

- 644
- 9
- 17