-1

Just a question no need for code adjustments!

So i have a main 'style.css' and inside that file i use the '@import url("custom.css");'

I have a style inside the top-container: margin-top:20px; but the site won't display the change..

If i move the top-container: margin-top:20px; to the style.css it works fine..

If I add top-container: margin-top:20px!important; that also works..

I can't understand why it would style is being ignored .

op1001
  • 348
  • 2
  • 8
  • 15
  • Sounds like a specificity issue to me. Add the `import` to the bottom of the stylesheet. – Josh Crozier Jan 02 '14 at 06:13
  • I thought import had to be at the top... no? – op1001 Jan 02 '14 at 06:15
  • 1
    My bad - you're right.. https://developer.mozilla.org/en-US/docs/Web/CSS/@import I'd suggest looking into how specificity is calculated here: http://www.w3.org/TR/CSS2/cascade.html#specificity It's likely that you could make the selector more specific. – Josh Crozier Jan 02 '14 at 06:16
  • possible duplicate of [CSS precedence](http://stackoverflow.com/questions/667223/css-precedence) – Wes Cossick Jan 02 '14 at 06:18
  • I think I figured it out.. in my code i had a row { margin 0 auto } and it was hiding on me... meanwhile I was calling the custom.css before this code which gave me the issues. – op1001 Jan 02 '14 at 06:19

1 Answers1

0

I think I figured it out.. in my code i had a row { margin 0 auto } and it was hiding on me... meanwhile I was calling the custom.css before this code which gave me the issues. –

op1001
  • 348
  • 2
  • 8
  • 15