15

STUPID STYLESHEETS!

I've got styles in index.php and styles in style.css. When I move the styles in index.php over to style.css THE WHOLE SITE BREAKS!?!?!?

ALL I DID WAS MOVE THEM! NO OTHER CHANGES!!!

I REALLY HATE CSS.

Comments
  • 9
    It's called precedence, in-line always prevails over style sheet, you gave them equal importance, and the wrong one lost 😊
  • 0
    @nbamaral but I _moved_ the styles. I didn't copy them. There is no duplicating going on. The ONLY styles available are the ones I moved from online to style sheet. None inline. Only in stylesheet.
  • 1
    @stackodev css is cascading, so please check if the style.css link is in the right place. If you have overridden any styles from a framework such as bootstrap, you'll need to link your stylesheet after other stylesheets.
  • 3
    @stackodev the css needs to be loaded in the same order.
    So if the css in the index file was loaded before the style.css, when you move it it also has to be before the rest of the css from there.
  • 3
    @stackodev imo you should try to disable cache (in chrome it's in the console, under Networking).
    The index.php is normally never cached, but style.css could be cached for a while.
  • 1
    Delete browser cache? Yea it can kill all kind of sh*t seriously...
  • 2
    @MrGKanev i totally agree with this, the amount of times CTRL-F5 has fixed issues is actually amazing.
  • 2
    @stackodev
    I know you did, but when they are loaded from the page they have a greater specificity than when they're imported from a style sheet.
    This can alter the final result, but shouldn't not really break the whole page. Try move them to it's own sheet loaded last.
  • 2
    Could be filepaths to images that the CSS references
Add Comment