我有一些非常基本的HTML和CSS,现在我已经知道我的代码很好(至少对我来说),并且图像加载到它们各自的字段中。但是一旦我刷新,它们就会消失。CSS图像在刷新时消失
我正在使用Coda 2,它使用Safari浏览器进行预览。我所有的代码如下:
<!DOCTYPE html>
<html>
<head>
<title>Input Images</title>
<link rel="stylesheet" type="text/css" href="css/input-image.css" />
</head>
</head>
<body>
<form>
<input type="text" id="email" />
<input type="text" id="twitter" />
<input type="text" id="web" />
</form>
</body>
</html>
input {
font-size: 120%;
color: #5a5854;
background-color: #f2f2f2;
border: 1px solid #bdbdbd;
border-radius: 5px;
padding: 5px 5px 5px 30px;
background-repeat: no-repeat;
background-position: 8px 9px;
display: block;
margin-bottom: 10px;}
input:focus, input:hover {
background-color: #ffffff;
border: 1px solid #b1e1e4;}
input#email {
background-image: url("images/email.png");}
input#twitter {
background-image: url("images/twitter.png");}
input#web {
background-image: url("images/web.png");}
它必须是ide的一些问题,尝试使用绝对路径为您的网址:'“/images/email.png”'。 – gfpacheco
这样的痛苦,但它的工作。这只是一个IDE问题,因为它看起来很奇怪。感谢指针,但。 – user3362856
我发布了它作为答案,如果它有用,请接受它。 – gfpacheco