fairytingle

   包含css样式表和js脚本的最好方式是使用外部文件,因为css/js和html标记文档可以清晰地分离。

    css的外部引用写在<head></head>中:

1 <head>
2     <link rel="stylesheet" href="styles/test.css" media="screen" />//注意是styles,/前空一格是为兼容性问题考虑
3 </head>

  js的调用最好写于文档末尾,</body>标签之前,可以使页面运行更快,详见js dom编程艺术P73:

1<script type="text/javascript" src="script/test.js"></script></body>

ps:css嵌入式样式:

1 <style type="text/css">
2     span{
3     color:red;
4 }
5 </style>

  css内联样式:

 1 <p style="font-size:1.6em;">字体大小 1.6 em</p> 

  js内联样式:

1 <script>
2  function xx( )
3 {
4 }
5 </script>

 

分类:

技术点:

相关文章:

  • 2021-12-13
  • 2021-11-17
  • 2021-10-30
  • 2022-12-23
  • 2021-11-24
  • 2022-01-19
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2021-08-12
  • 2022-02-09
  • 2021-08-02
  • 2021-10-08
  • 2021-12-06
  • 2022-02-08
  • 2021-11-19
相关资源
相似解决方案