简体   繁体   中英

Cant link my HTML and CSS

I cant make my HTML and CSS code link. (Yes, i have looked it up, but it still wont work)

My HTML code

(Name: test1.html , complete path: /tacocraft.net/tacocraft.net/testing-and-stuff/test1.html/ )

    <!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type= "text/css" href="test1css.css" />

<body>

<h3>Please input username and password</h3>

<div>
  <form action="/action_page.php">
    <label for="fname">Username</label>
    <input type="text" id="fname" name="firstname" placeholder="Username(Admin)">

    <label for="lname">Password</label>
    <input type="text" id="lname" name="lastname" placeholder="Password(Admin)">

    <input type="submit" value="Submit">
  </form>
</div>

</body>
</html>

And my CSS (Name test1css.css , path: /tacocraft.net/tacocraft.net/testing-and-stuff/test1css.css/ )

    input[type=text], select {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type=submit] {
    width: 100%;
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type=submit]:hover {
    background-color: #45a049;
}

div {
    border-radius: 5px;
    background-color: #f2f2f2;
    padding: 20px;
}

You are missing the closing </head> tag. Without the </head> it will not properly link, as it views the rest of it to be nested in the head. The CSS never takes effect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM