FWIW, the problem you were likely facing was that CSS will apply properties:
- based on their specificity
- and if there's a tie for specificity, it'll use the last declaration in your file.
In your case, you've linked to your CSS file in the body of your page. If you happened to inline a new style in the head of your page (which is, obviously, above your body), the web browser will encounter two different declarations trying to set the background image of your page's body:
- The first one through your embedded <style> tags, which is in your head.
- The second one through your css file, which is in your body.
Both of them are applied using the
body selector, so they tie in terms of specificity - and the browser will use the last one, which is your default.
By setting an id on your body, and then applying styles to the id, you've got a more specific selector for that declaration, so it'll trump anything else.