html基本写法,引入css样式和js

css样式

1元素内嵌样式 使用属性style    style="background-color:red;color:white"

2文档内嵌样式 使用元素style  

<style type="text/css">

              a{

                 background-color:red;color:white

               }

 <style>

3使用外部样式表

<link rel="stylesheet" type="text/css" href="">

为页面定义网站标志

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">

指定样式使用的媒体

<style media="screen AND (max-500px)" type="text/css" ></style>//屏幕显示时且小于500px时显示的样式

//从其他样式表中导入样式

@import语句必须在css文档最上面 例:css中:@import "styles.css";

能出现在@import语句之前的只有@charset语句

@charset "UTF-8"

js脚本

使用script元素

<script type="text/javascript"></script>

引入外部脚本

<script src=''></script>

原文地址:https://www.cnblogs.com/cumting/p/6726745.html