网页开发中用到的插件

1、编辑器Markdown

https://pandao.github.io/editor.md/

用法:

  1. 将文件下载下来,解压缩

  2. 将解压后的文件中的一些文件导入自己的项目中

  3. 引入css样式

    <link rel="stylesheet" href="../css/editormd.css" />
    
  4. 引入js文件

    <script src="js/jquery.min.js"></script>
    <script src="../editormd.min.js"></script>
    
  5. 定义textarea标签

    <div class="field"><div id="md-content" style="z-index: 1 !important;"><textarea name="content" placeholder="博客内容" style="display: none;">[TOC]#### Disabled options- TeX (Based on KaTeX);- Emoji;- Task lists;- HTML tags decode;- Flowchart and Sequence Diagram;</textarea></div>
    </div>
    
  6. 定义js

     <script type="text/javascript">
    var testEditor;$(function() {testEditor = editormd("对应包含textarea的id", {width   : "90%",height  : 640,syncScrolling : "single",path    : "../lib/"});/*// ortestEditor = editormd({id      : "test-editormd",width   : "90%",height  : 640,path    : "../lib/"});*/});</script>
    

2、内容排版typo.css

https://github.com/sofish/typo.css

用法:

  1. 下载源文件

  2. 将css文件导入项目

  3. 由于typo.css中的样式和semantic ui中的样式有些冲突所有稍微修改一下typo.css中的样式

    @charset "utf-8";.typo p {font-size: 16px;font-weight: 300;line-height: 1.8;text-align: justify;
    }.typo li {font-weight: 300;padding: 4px 0;
    }/* 重设 HTML5 标签, IE 需要在 js 中 createElement(TAG) */
    .typo article, aside, details, figcaption, figure, footer, header, menu, nav, section {display: block;
    }/* HTML5 媒体文件跟 img 保持一致 */
    .typo audio, canvas, video {display: inline-block;
    }/* 要注意表单元素并不继承父级 font 的问题 */
    .typo button, input, select, textarea {font: 300 1em/1.8 PingFang SC, Lantinghei SC, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif;
    }.typo button::-moz-focus-inner,
    .typo input::-moz-focus-inner {padding: 0;border: 0;
    }/* 去掉各Table cell 的边距并让其边重合 */
    .typo table {border-collapse: collapse;border-spacing: 0;
    }/* 去除默认边框 */
    .typo fieldset, img {border: 0;
    }/* 块/段落引用 */
    .typo blockquote {position: relative;color: #999;font-weight: 400;border-left: 1px solid #1abc9c;padding-left: 1em;margin: 1em 3em 1em 2em;
    }@media only screen and ( max-width: 640px ) {.typo blockquote {margin: 1em 0;}
    }/* Firefox 以外,元素没有下划线,需添加 */
    .typo acronym, abbr {border-bottom: 1px dotted;font-variant: normal;
    }/* 添加鼠标问号,进一步确保应用的语义是正确的(要知道,交互他们也有洁癖,如果你不去掉,那得多花点口舌) */
    .typo abbr {cursor: help;
    }/* 一致的 del 样式 */
    .typo del {text-decoration: line-through;
    }.typo address, caption, cite, code, dfn, em, th, var {font-style: normal;font-weight: 400;
    }/* 去掉列表前的标识, li 会继承,大部分网站通常用列表来很多内容,所以应该当去 */
    .typo ul, ol {list-style: none;
    }/* 对齐是排版最重要的因素, 别让什么都居中 */
    .typo caption, th {text-align: left;
    }.typo q:before,.typo  q:after {content: '';
    }/* 统一上标和下标 */
    .typo sub,.typo  sup {font-size: 75%;line-height: 0;position: relative;
    }.typo :root sub,.typo  :root sup {vertical-align: baseline; /* for ie9 and other modern browsers */
    }.typo sup {top: -0.5em;
    }.typo sub {bottom: -0.25em;
    }/* 让链接在 hover 状态下显示下划线 */
    .typo a {color: #1abc9c;
    }.typo a:hover {text-decoration: underline;
    }.typo a {border-bottom: 1px solid #1abc9c;
    }.typo a:hover {border-bottom-color: #555;color: #555;text-decoration: none;
    }/* 默认不显示下划线,保持页面简洁 */
    .typo ins,.typo  a {text-decoration: none;
    }/* 专名号:虽然 u 已经重回 html5 Draft,但在所有浏览器中都是可以使用的,* 要做到更好,向后兼容的话,添加 class="typo-u" 来显示专名号* 关于 <u> 标签:http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-u-element* 被放弃的是 4,之前一直搞错 http://www.w3.org/TR/html401/appendix/changes.html#idx-deprecated* 一篇关于 <u> 标签的很好文章:http://html5doctor.com/u-element/*/
    .typo u,.typo  .typo-u {text-decoration: underline;
    }/* 标记,类似于手写的荧光笔的作用 */
    .typo mark {background: #fffdd1;border-bottom: 1px solid #ffedce;padding: 2px;margin: 0 5px;
    }/* 代码片断 */
    .typo pre,.typo  code,.typo  pre tt {font-family: Courier, 'Courier New', monospace;
    }.typo pre {background: #f8f8f8;border: 1px solid #ddd;padding: 1em 1.5em;display: block;-webkit-overflow-scrolling: touch;
    }/* 一致化 horizontal rule */
    .typo hr {border: none;border-bottom: 1px solid #cfcfcf;margin-bottom: 0.8em;height: 10px;
    }/* 底部印刷体、版本等标记 */
    .typo small,.typo  .typo-small,/* 图片说明 */
    .typo figcaption {font-size: 0.9em;color: #888;
    }.typo strong,.typo  b {font-weight: bold;color: #000;
    }/* 可拖动文件添加拖动手势 */
    .typo [draggable] {cursor: move;
    }.typo .clearfix:before,.typo  .clearfix:after {content: "";display: table;
    }.typo .clearfix:after {clear: both;
    }.typo .clearfix {zoom: 1;
    }/* 强制文本换行 */
    .typo .textwrap,.typo .textwrap td,.typo  .textwrap th {word-wrap: break-word;word-break: break-all;
    }.typo .textwrap-table {table-layout: fixed;
    }/* 提供 serif 版本的字体设置: iOS 下中文自动 fallback 到 sans-serif */
    .typo .serif {font-family: Palatino, Optima, Georgia, serif;
    }/* 保证块/段落之间的空白隔行 */
    .typo p, .typo pre, .typo ul, .typo ol, .typo dl, .typo form, .typo hr, .typo table,
    .typo-p, .typo-pre, .typo-ul, .typo-ol, .typo-dl, .typo-form, .typo-hr, .typo-table, blockquote {margin-bottom: 1.2em
    }.typo h1,.typo  h2,.typo  h3,.typo  h4,.typo  h5,.typo  h6 {font-family: PingFang SC, Verdana, Helvetica Neue, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif;font-weight: 100;color: #000;line-height: 1.35;
    }/* 标题应该更贴紧内容,并与其他块区分,margin 值要相应做优化 */
    .typo h1, .typo h2, .typo h3, .typo h4, .typo h5, .typo h6,
    .typo-h1, .typo-h2, .typo-h3, .typo-h4, .typo-h5, .typo-h6 {margin-top: 1.2em;margin-bottom: 0.6em;line-height: 1.35;
    }.typo h1, .typo-h1 {font-size: 2em;
    }.typo h2, .typo-h2 {font-size: 1.8em;
    }.typo h3, .typo-h3 {font-size: 1.6em;
    }.typo h4, .typo-h4 {font-size: 1.4em;
    }.typo h5, .typo h6, .typo-h5, .typo-h6 {font-size: 1.2em;
    }/* 在文章中,应该还原 ul 和 ol 的样式 */
    .typo ul, .typo-ul {margin-left: 1.3em;list-style: disc;
    }.typo ol, .typo-ol {list-style: decimal;margin-left: 1.9em;
    }.typo li ul, .typo li ol, .typo-ul ul, .typo-ul ol, .typo-ol ul, .typo-ol ol {margin-bottom: 0.8em;margin-left: 2em;
    }.typo li ul, .typo-ul ul, .typo-ol ul {list-style: circle;
    }/* 同 ul/ol,在文章中应用 table 基本格式 */
    .typo table th, .typo table td, .typo-table th, .typo-table td, .typo table caption {border: 1px solid #ddd;padding: 0.5em 1em;color: #666;
    }.typo table th, .typo-table th {background: #fbfbfb;
    }.typo table thead th, .typo-table thead th {background: #f1f1f1;
    }.typo table caption {border-bottom: none;
    }/* 去除 webkit 中 input 和 textarea 的默认样式  */
    .typo-input, .typo-textarea {-webkit-appearance: none;border-radius: 0;
    }.typo-em, .typo em, legend, caption {color: #000;font-weight: inherit;
    }/* 着重号,只能在少量(少于100个字符)且全是全角字符的情况下使用 */
    .typo-em {position: relative;
    }.typo-em:after {position: absolute;top: 0.65em;left: 0;width: 100%;overflow: hidden;white-space: nowrap;content: "・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・";
    }/* Responsive images */
    .typo img {max-width: 100%;
    }

3、动画animate.css

https://daneden.github.io/animate.css/

用法:

  1. 下载css文件或者使用在线的cdn

  2. cdn:

    <link
    rel="stylesheet"
    href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
    />
    

4、代码高亮

https://prismjs.com/

用法:

  1. 官网下载自己喜欢的样式的css和js文件

  2. 将文件引入项目

  3. 将代码用pre标签包裹,并加上language-css类

    <pre><code class="language-css">p { color: red }</code>
    </pre>
    

5、目录生成

https://tscanlin.github.io/tocbot/

用法:

  1. 官网下载源文件后,将文件目录dist中的css和js文件导入项目

  2. 进行初始化

    tocbot.init({// Where to render the table of contents.// 在显示目录的区域添加js-toctocSelector: '.js-toc',// Where to grab the headings to build the table of contents.// 在需要生成目录的内容中添加js-toc-contentcontentSelector: '.js-toc-content',// Which headings to grab inside of the contentSelector element.headingSelector: 'h1, h2, h3',// For headings inside relative or absolute positioned containers within content.hasInnerContainers: true,
    });
    

6、二维码生成

https://davidshimjs.github.io/qrcodejs/

用法:

  1. 下载源文件

  2. 将其中的js文件导入项目

  3. 引入js文件

  4. 添加如下代码

    var qrcode = new QRCode("需要显示二维码标签的id", {text: "跳转到的网站",width: 128,height: 128,colorDark : "#000000",colorLight : "#ffffff",correctLevel : QRCode.CorrectLevel.H
    });
    

7、滚动条平滑滚动

https://github.com/flesler/jquery.scrollTo

用法:

  1. 引入cdn

    <script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
    
  2. 在回到顶部中添加id然后添加js代码

    $("#toTop-button").click(function () {$(window).scrollTo(0,500);
    })
    

8、滚动监测

用法:

  1. 下载源文件,解压将lib目录下的js文件导入项目

  2. 项目引用js文件

  3. 添加如下js代码

    var waypoint = new Waypoint({element: document.getElementById('waypoint'),handler: function(direction) {console.log('Scrolled to waypoint!')}
    })
    

网页开发中用到的插件相关推荐

  1. 前端-个人网页开发最常用的插件Superslide 与 swiper

    给初入前端的同学,安利2个轮播图插件 SuperSlide 与 Swiper ! SuperSlide PC端与移动端 的轮播图特效都是分开写2个js插件,而Swiper 基本一个插件可以写PC端与移 ...

  2. 网页开发工具介绍,VS Code安装与使用和插件安装

    目录 网页开发工具 VS Code安装 VS Code使用小技巧 插件 网页开发工具 VS Code安装 下载地址:Download Visual Studio Code 下载速度很慢的话,右击下载文 ...

  3. Web开发实用浏览器(工具)插件

    1.PowerBand PowerBand是一个IE的插件(同时也支持MyIE2/Maxthon).提供了对HTML动态分析,跟踪,编辑的功能.能够方便快捷的分析HTML页面的结构,有助于网页设计人员 ...

  4. 前端开发推荐的火狐插件扩展

    前端开发推荐的火狐插件扩展 火狐好用的插件有很多,主要看你是做什么工作了,比如我是做网站前端的,有一些调试页面的插件就不可缺少了,如firebug.web developer等. 秀一下我收藏的火狐插 ...

  5. 新手篇——学习网页开发需要多长时间就能找到工作

    2019独角兽企业重金招聘Python工程师标准>>> 近几年Web前端框架层出不穷,比如 React, Vue, AngulaJS等吸引了大量的注意力,前端技术发展势头迅猛,各大互 ...

  6. web前端网页开发离不开的三要素:HTML、CSS、JavaScript

    前端开发是目前高薪岗位之一,是从最开始的页面开发不断发展优化而产生的一个特定的岗位.现在web前端开发一定会用到的三门技术:HTML.CSS.JavaScript.无论是多么炫酷的页面都是这三门技术的 ...

  7. .net开发中用BackgroundWorker实现多线程

    http://www.111cn.net/net/net/74654.htm BackgroundWorker是?net里用来执行多线程任务的控件,它允许编程者在一个单独的线程上执行一些操作.现在我们 ...

  8. android 翻译功能开发,手把手教你开发Android studio翻译插件

    前言 由于我英语很烂,写代码的时候需要用英文命名,有些单词不知道,就只能切换到浏览器打开网页搜索,再拿到英文单词.这样每次都要切换出去,很麻烦,于是,就想着开发一个Android studio插件,在 ...

  9. web前端知识总结二(css(其他)+移动web网页开发)

    web前端知识总结二(css(其他)+移动web网页开发) 文章目录 web前端知识总结二(css(其他)+移动web网页开发) 字体图标 平面转换-位移 位移:绝对定位居中 开门效果 旋转 转换原点 ...

最新文章

  1. listview的divider边距
  2. linux下sudo权限管理
  3. jQuery的入口函数
  4. python深度学习NER任务中:对段落的分割
  5. 看完这篇操作系统,和面试官扯皮就没问题了!
  6. 数据仓库之电商数仓-- 3.4、电商数据仓库系统(ADS层)
  7. Apache Pulsar的多租户消息系统
  8. 美剧深度扫盲:有线电视台之风起云涌--之一(转载)
  9. c# mysql分页_c#-数据库分页查询
  10. Python爬虫实战之爬取饿了么信息
  11. Word2Vec与文章相似度
  12. HDFS副本存放策略(官方文档)
  13. ceph L版本相对于J版本在scrub机制上做的优化
  14. 你了解设计公司的服务内容有哪些吗?
  15. android ellipsize的使用
  16. 自定义select标签
  17. 【机器人小游戏---html(附源代码)】
  18. 小孔成像总结_相机标定是怎么回事——相机成像数学模型
  19. C/C++中strstr()函数:返回字符串中首次出现子串的地址
  20. 仰望星空 ecnu

热门文章

  1. 高通平台调试Nxp Smart PA-TFA9897
  2. u盘装linux 5.8,用U盘安装centos5.8网络版
  3. 如何学好图像处理--从小白到大神。
  4. 调用python-can库使用周立功CAN接口卡发送数据
  5. uni-app checkbox限制选中数量 移除选中样式
  6. Linux 系统 top 命令详解
  7. 怎么设置html自动翻页,看小说怎么设置自动翻页 设置自动翻页方法介绍
  8. python 0or2_Python表达式 0 and 1 or not 2True的值为(     )
  9. 线程池与Android的日日夜夜
  10. as3中得到swf文件中的链接名字