Home > database >  Cannot style anything with CSS anymore
Cannot style anything with CSS anymore

Time:04-18

I'm trying to do a simple rock paper scissors game, but my css isn't being applied. Here is my code:

(Header included outside of snippet)

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="styles.css">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  </head>
...
</html>

#gameDiv {
  font-family: 'Brush Script MT', 'cursive';
  border: 3px solid;
  border-radius: 25px;
  background-color: grey
}
<body>
  <div id="gameDiv">
    <h1  id="playertext">Player :</h1>
    <h1  id="comptext">Computer :</h1>
    <h1  id="resulttext">Result :</h1>

    <button  id="rock">Rock✊</button>
    <button  id="paper">Paper✋</button>
    <button  id="scissors">Scissors✌️</button>
  </div>
  <script src="index.js"></script>
</body>

Also wanted to note that this is my first question and i'm a new programmer, so sorry if this is stupid

CodePudding user response:

Ctrl F5, sometimes clearing the cache helps.

CodePudding user response:

You should check the href in <link rel="stylesheet" href="styles.css"> and make sure your styles.css is actually where it is meant to be. right now your saying it should in the root folder or the same folder where your html file is. If your css in another folder you need to go that folder by setting href to ./folder/styles.css or if your html is another folder you need to get out of that folder by setting href to ../styles.css

  • Related