-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-相對網址 –