是否可以在 Html 页面的正文中包含样式和脚本?在我使用的论坛上,我意识到我可以使用内联样式在其中使用其他 html,但是我可以将它放在正文中并使用它吗?
是否可以将此代码直接放入 html 文件的正文中?
<!-- Scripts and Themes for Syntax Highlighter, put in place on this thread by Fabian Cook (CyberPython) - Moderator -->
<!-- Core JS File -->
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<!-- Java Theme -->
<script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/css/shBrushJava.js"></script>
<!-- Core Theme -->
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<!-- Core Style -->
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript"></script>
<!-- Script to highlight syntax -->
<script type="text/javascript">SyntaxHighlighter.all()</script>
然后也使用它
<pre class="brush:java">
package tutorial;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String execute() {
name = "Hello, " + name + "!";
return SUCCESS;
}
}
</pre>