0
我试图在页面上添加徽标,并且由于某些原因无法将图像加载到页面 。在Grails 3.2.8中不使用CSS显示图像
test.css:(/资产/样式表)
.logo {
background-image: url("../images/testimage.png") ;
width:124px;
height:95px;
float:left;
margin:0 0 0 0;}
index.gsp中:(/的grails-应用/观看次数)
<!doctype html>
<html>
<head>
<meta name="layout" content="main"/>
<title>Welcome to Grails</title>
</head>
<body> <div class="logo"></div></body>
</html>
testimage.png(/ assets/images/testimage.png)
它只是一个小事情,它不工作。
感谢 普加
你真的有下'/ assets'你GSPS? – injecteer
是的。其在/assets/views/index.gsp – groovynew
gsps实际上应该在'/ grails-app/views'下。 – injecteer