首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法链接我的HTML和CSS

无法链接我的HTML和CSS
EN

Stack Overflow用户
提问于 2018-06-21 03:37:31
回答 1查看 54关注 0票数 1

我不能使我的HTML和CSS代码链接。(是的,我查过了,但还是不行)

我的HTML代码

(名称:test1.html,完整路径:/tacocraft.net/tacocraft.net/testing-and-stuff/test1.html/)

代码语言:javascript
复制
    <!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>

和我的CSS (Name test1css.css,path: CSS

代码语言:javascript
复制
    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;
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-21 03:42:05

您缺少结束的</head>标记。如果没有</head>,它将无法正确链接,因为它会将其其余部分嵌套在头部中。CSS永远不会生效。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50955852

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档