-1
我试图使用下面的代码在后台设置图像,但输出结果是空白的。请帮忙!css样式标记不起作用
<html>
<head>
<title>Hotel Registration form</title>
<style type="text/css">
body{
background-image: url(file:///C:/Users/user/Desktop/WE/Pics/prac6/resort.jpg);
background-repeat: no-repeat;
}
</style>
</head>
<body>
</body>
</html>
'file://'URI是众所周知的。改为使用相对URI。 – Quentin
使用图像的相对路径。例如,如果图像与html文件位于同一个文件夹中,它将只是'background-image:url(resort.jpg);' – APAD1
@guneet使用图像的相对url http://stackoverflow.com/questions/ 2005079 /绝对-VS-相对网址 –