S1LV3R
S1LV3R

Reputation: 135

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;
}

Upvotes: 1

Views: 78

Answers (1)

Willow Wisp
Willow Wisp

Reputation: 76

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.

Upvotes: 6

Related Questions