我用php构建了自己的模板系统。 一个简短的例子只是为了解释我的问题:
<!DOCTYPE HTML>
<html lang="de">
<head>
<link rel="stylesheet" type="text/css" href="../css/main.css" />
</head>
<body>
<?php include('body.html'); ?>
</body>
</html>
现在,当我使用Netbeans打开body.html文件
时<div class="content">
Hello
</div>
Netbeans说:未找到课程内容
是否可以将css文件分配给html文件,以便Netbeans找到该类?
答案 0 :(得分:3)
最好在PHP的帮助下拍摄它,但反之亦然:
pgup.php
<!DOCTYPE HTML>
<html lang="de">
<head>
<link rel="stylesheet" type="text/css" href="../css/main.css" />
</head>
<body>
的index.php
<?php include('pgup.php'); ?>
<div id="content" class="content">
Hello
</div>
<?php include('pgdown.php'); ?>
pgdown.php
</body>
</html>
的main.css
/*(for id)*/
#content{
}
/*(or for class)*/
.content{
}
答案 1 :(得分:1)
找不到类内容:
**This means, the class named "content" is not defined or not found in HTML/CSS file(s).**
因此,要么创建一个新的CSS文件并从html页面进行引用,要么使用标记来定义body.html本身的CSS定义。