Ahmed Nader
Ahmed Nader

Reputation: 181

why HTML Codes and css are not working on browser?

I am creating a simple website using vscode and wamp but the problem is that when I change any html nothing happens. actually I have two input tags and divs but they don't appear. I disabled the cache from chrome dev tools and meta tags but nothing happens and I tried xampp but nothing happens again.

any help ?

HTML::

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Admin</title>
        <meta http-equiv="cache-control" content="max-age=0" />
        <meta http-equiv="cache-control" content="no-cache" />
        <meta http-equiv="pragma" content="no-cache" />
        <link href="index.css" type="text/css" rel="stylesheet"/>
        <script src="register_ajax.js" type="text/javascript"/>
    </head>
    <body>
        <div class="box">
            Username:
            <input type="text" name="username"/>
            Password:
            <input type="text" name="password"/>
        </div>
    </body>
</html>

CSS::

* {
    margin: 0;
    padding: 0;
}

body {
    background-color: rgb(186, 196, 38);
}

.box {
    background-color: rgb(0, 0, 0);
    width: 100%;
    height: 50px;
    border: 1px solid rgb(75, 35, 35);
}

input {
    width: 100px;
    height: 50px;
}

UPDATE::

when I change css background color of body for testing the color never changes although I disabled cache in dev tools. however when I open dev tools while refreshing the color changes but the html is still invisible as if I didn't write any html

enter image description here

Upvotes: 1

Views: 4301

Answers (1)

user78403
user78403

Reputation: 352

A script tag MUST be written as an opening and a closing tag. This means, instead <script src="register_ajax.js" type="text/javascript"/> write <script src="register_ajax.js" type="text/javascript"></script>. After correcting that mistake everything worked fine on my computer.

Upvotes: 3

Related Questions