2013-07-20 220 views
0

这是我第一次制作移动应用程序。我正在使用Dreamweaver。没有显示背景图片。未显示背景图片

HTML

<!doctype html> 
    <html> 
    <head> 
    <style type="text/css"> 

    </style> 
    <meta charset="utf-8"> 
    <title>Untitled Document</title> 
    <link href="css/style.css" rel="stylesheet" type="text/css"> 
    </head> 

    <body class="main-page"> 

    </body> 
    </html> 

CSS文件

@charset "utf-8"; 
/* CSS Document */ 
body.main-page 
{ 
    background-attachment: fixed; 
    background-image: url (images/home_main.jpg); 
    background-repeat: no-repeat; 
} 
+1

使用'background-image:url('images/home_main.jpg');'也请确保url是正确的。如果您不确定,请使用以http://开头的整个网址进行测试。 – RST

+0

@RST看起来像是在网站目录中,因为他写了一个相对路径。 – leoMestizo

+0

请不要在一个方框中提出2个问题。 –

回答

1

删除URL值和括号之间的空间:

background: url("Your url"); 

下面是上述CSS规则演示: Fiddle

相反的:

background: url ("Your url"); 

而这里的这个其它CSS规则DEMO:Fiddle