CSS not working (not going to the webview output)

Does anyone know why when I run this project the Main.css never comes up on the screen? Please if you have any ideas reply because i really need help.

The Project

Index.html

<!DOCTYPE html>
<html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="utf-8">
  <title>Login / Sign Up Form</title>
  <link rel="shortcut icon" href="/assets/favicon.ico">
  <link rel="stylesheet" href="./src/main.css">
  </head>

<body>
<div class="container">
<form class="form" id="login">
  <h1 class="form__title">Login</h1>
  <div class="form__message form__message--error">Incorrect  username / password combination.</div>
   <div class="form__input-group">
    <input type="text" class="form__input" autofocus placeholer="Username or Email">
    <div class="form__input-error-message">This is an error message</div>
  </div>
   <div class="form__input-group">
    <input type="text" class="form__input" autofocus placeholer="Password">
    <div class="form__input-error-message"></div>
  </div>
  <button class="form__button" type="submit">Continue</button>
  <p class="form__text">
    <a href="#" class="form__link">Forgot your password?</a>

    <p class="form__text">
    <a class="form__link" href="./" id="linkCreateAccount">Don't have an account? Create account.</a>
</form>

</div>
<script src="./src/main.js"></script>
</body>

Main.css

body {
  --color-primary: #009579;
  --color-primary-dark: #007f67;
 --color-secondary: #252c6a;
  --color-error: #cc3333;
  --color-success: #4bb544;
  --border-radius: 4xp;

  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-items: center;
  font-size: 18px;
  background: url(./Background.gif);
  background-size: cover;
}
.container {
  width: 400px;
  max-width: 400px;
  margin: 1rem;
  padding: 2rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  background: #ffffffff;
}

It’s a bug. Sometimes the css takes a while to update.

No, I don’t think it is because it’s been left for hours and other projects work instantly.

There is no src folder. It’s as simple as that. Hope this helped. :thinking:

Also, as a rule of thumb, PLEASE check the file the link header or src or whatever you’re using is pointing to. Review your code over and over, and also see stackoverflow or ask for help here if you think you’ve excluded the possibility that it’s a problem with your current code. Thanks.

5 Likes

That’s makes sense. Thanks!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.