css javascript都建议放到html的head标签中
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>html中使用css,javascript</title>
<!--css内嵌样式代码-->
<style type="text/css">
h1,h2,p{
color: red;
font-size: 20px;
font-weight: bold;
}
p a{ color: red;font-size: 30px}
h3 {color: red;text-decoration: underline}
h3 strong{font-size: 40px}
</style>
<!--省略text声明-->
<style>
a:link {color:red}
a:visited {color: green}
a:hover {color: blue}
a:active {color: orange}
</style>
<script type="text/javascript" language="javascript">
document.write("哈哈哈哈");
</script>
<!--省略text,language声明,建议省略language-->
<script>
x=document.getElementById("intro");
document.write("<p>来自 intro 段落的文本:" + x.innerHTML + "</p>");
</script>
<!--引用外部js文件-->
<script src="helloword.js">
</script>
</head>
<body>
</body>
</html>
在html5中使用type属性来指明脚本的语言类型,如果脚本是javascript,还可以使用language来表示语言的脚本类型,在html5中建议使用type属性,省略language 或者都省略