2012-07-19 136 views
0

我正在做一个小软件,它有一个QWebView来显示HTML文件。我的问题是我的欢迎页面显示不好。它看起来像this,它应该在中间的那些红线之间有一个图像。这个问题肯定是我的HTML和/或CSS. So here is my HTML`:HTML页面不会显示在QWebview

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Untitled Document</title> 
<link href="styles/accueil.css" rel="stylesheet" type="text/css" media="screen" /> 
</head> 

<body> 

    <div class="container"> 

     <div class="ligne">&nbsp;</div> 

    </div> 

    <div class="ligne">&nbsp;</div>  
</body> 
</html> 

而且我CSS

@charset "UTF-8"; 
/* CSS Document */ 

body{ 
    background-color:white; 
    margin:0 auto; 
    height:100%; 
} 

html { 
    overflow-y: scroll; 
    height:100%; 
} 

img{ 
    border:none; 
} 

.container { 
    min-height: 100%; 
    height: auto !important; 
    height: 100%; 
    margin: 0 auto -20px; 
    background-image: url(../icones/accueil.jpg); 
    background-repeat:no-repeat; 
    background-position:center center; 
} 

.ligne{ 
    width:100%; 
    height: 20px; 
    background-color:#ee1b2e; 
} 

的是我写的不对任何想法?

谢谢!

------编辑------

只在XP这种情况发生......对MAC,7和Vista它的工作原理发现有。它应该看起来像this

+0

别人如果有人有另一种方式来制作一个这样的网页,我会尝试它!我在HTML CSS中并不擅长,所以我很开放 – castors33 2012-07-20 13:18:35

回答

0

我不知道确切原因,但问题是我的形象......我需要有,而不是.jpg格式

0

我想这是一个PNG图片是当你使用在没有安装Qt的计算机上用qwebview编程。如果是这样,请添加到程序目录文件夹[imageformats]。只需从Qtdir复制它。默认情况下,Qt支持* .png和* .svg格式,对于* .jpg和其他格式的dll是windows所必需的。