html - 即使完成链接href,将HTML链接到CSS也有问题,文件位于同一文件夹中
问题描述
试图开始我的编码之旅并遇到了一个问题。有 2 段文本,一段 html 和一段 css,我无法将它们链接在一起。他们来了:
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css-stuff.css">
</head>
<body bgcolor = brown>
<div class = "container">
<img src="https://ih0.redbubble.net/image.427712605.8856/flat,750x,075,f-pad,750x1000,f8f8f8.jpg">
<form id="outsideBox" method = "post">
<ul style="list-style-type:none;">
<li>
<label for "email">Email: </label>
<input type = "text" id="email" name="email_adress">
</li>
<li>
<label for "password">Password</label>
<input type = "text" id="password" name="pw_input">
</li>
<li class = "button">
<button id="clickMe" type = "button"> Login</button>
</li>
</ul>
</form> </div>
</html>
和CSS:
body{
background-image: url(https://images.unsplash.com/photo-1518839283416-0cc546d12a97?ixlib=rb-1.2.1&w=1000&q=80);
background-repeat: round;
}
.container{
background-image: url(https://img.pngio.com/purple-background-png-png-group-romolagaraiorg-1920_1080.png);
/* form position */
position: relative;
top: 100px;
left: 600px;
/*---------------*/
width: 267px;
border-style: outset;
padding: 10px;
border-radius: 1em;
display: inline-block;
text-align: right
}
img{
width:100px;
height: 100px;
border-radius: 50%;
margin-right: 75px
}
ul{
color:white;
}
这是他们两个,他们在 codepen 上工作,但不会在 atom 中编译。
解决方案
你应该把点和斜线放在相同的顺序。像这样 :
<link rel="stylesheet" href="./css-stuff.css">
推荐阅读
- javascript - limitToLast() 只检索最后 5 个还是检索整个对象?
- python - 简单的进度条
- python - 将dict的重复键:值对转换为父母
- salesforce - JSON 从 Apex 传递到 Lightning 组件并将其显示在数据表中
- mysql - 如何创建正确的数据库结构以避免重复数据
- java - getter/setter在封装中的作用是什么?
- python - 硒多窗口刮。Python
- javascript - JS:从异步函数提前触发返回的承诺
- jquery - 多色选定区域 - Seiyria 的引导滑块
- c++ - 如何在 Qt 中将游戏手柄用作鼠标