JS 计算时间差,(引入外部字体文件)

JavaScript Date() 对象:

  new Date() :时间对象,会把当前时间作为其初始值;

  setFullYear() :用于设置月份,可有三个参数,setFullYear(year,month,day);

  setHours() :设置指定时间的小时,可有四个参数,setHours(hour,min,sec,millisec);

  getDate() :返回月份的某一天;

  getMonth() :返回表示月份的数字;

  getFullYear() :返回一个表示年份的 4 位数字;

  getTime() :返回距 1970 年 1 月 1 日之间的毫秒数;

  setFullYear() :设置年份;

  setDate() :设置日;

  点击查看详情

  

CSS

       @font-face{
            font-family: "Digital-7 Mono";
            src: url('Digital-7Mono.TTF');
        }
        div{
            width: 500px;
        } 
       .contain{
            text-align: right;
            font-size: 18px;
            margin-top: 10px;
            margin-bottom: 10px;
        }
        .contain span{
            font-family: "Digital-7 Mono";
            font-size: 36px;
            color: #555;
            padding-left: 10px;
        }       

 

HTML

<div class="contain">div>

 

JS


 

不用安装到本地,直接引用外部字体文件

  @font-face{
            font-family: "Digital-7 Mono";
            src: url('Digital-7Mono.TTF');
        }

  URL 是文件的路径

 

转载于:https://www.cnblogs.com/wyhlightstar/p/6703998.html

你可能感兴趣的:(JS 计算时间差,(引入外部字体文件))