代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon" sizes="76x76" href="/blog/img/favicon.png">
<link rel="icon" type="image/png" href="/blog/img/favicon.png">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta name="theme-color" content="#35495e">
<meta name="description" content="小菜头的博客,主要记录学习笔记,包含:html,css,javascript,jQuery,vue等">
<meta name="author" content="A-cai">
<meta name="keywords" content="html,css,javascript,jQuery,vue">
<title>A-cai的blog</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />
<!-- 主题依赖的图标库,不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_yg9cfy8wd6.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_pjno9b9zyxs.css">
<link rel="stylesheet" href="/blog/css/main.css" />
<!-- 自定义样式保持在最底部 -->
<script src="/blog/js/utils.js" ></script>
<meta name="generator" content="Hexo 4.2.0"></head>
<body>
<header style="height: 100vh;">
<nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
<div class="container">
<a class="navbar-brand"
href="/blog/"> <strong>A-cai的学习笔记</strong> </a>
<button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<div class="animated-icon"><span></span><span></span><span></span></div>
</button>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto text-center">
<li class="nav-item">
<a class="nav-link" href="/blog/">
<i class="iconfont icon-home-fill"></i>
首页
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/archives/">
<i class="iconfont icon-archive-fill"></i>
归档
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/categories/">
<i class="iconfont icon-category-fill"></i>
分类
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/tags/">
<i class="iconfont icon-tags-fill"></i>
标签
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/about/">
<i class="iconfont icon-user-fill"></i>
关于
</a>
</li>
<li class="nav-item" id="search-btn">
<a class="nav-link" data-toggle="modal" data-target="#modalSearch"> <i
class="iconfont icon-search"></i> </a>
</li>
</ul>
</div>
</div>
</nav>
<div class="banner intro-2" id="background" parallax=true
style="background: url('/blog/img/default.png') no-repeat center center;
background-size: cover;">
<div class="full-bg-img">
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
<div class="container text-center white-text fade-in-up">
<span class="h2" id="subtitle">
</span>
</div>
<div class="scroll-down-bar">
<i class="iconfont icon-arrowdown"></i>
</div>
</div>
</div>
</div>
</header>
<main>
<div class="container nopadding-md">
<div class="py-5" id="board"
style=margin-top:0>
<div class="container">
<div class="row">
<div class="col-12 col-md-10 m-auto">
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91%E8%A7%84%E8%8C%83/">前端开发规范</a>
<a href="/blog/2020/06/26/%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91%E8%A7%84%E8%8C%83/" class="index-excerpt">
<div>前端代码规范Front Standard Guide
前端 JS 项目开发规范规范的目的是为了编写高质量的代码,让你的团队成员每天的心情都是愉悦的,大家在一起是快乐的。
引自《阿里规约》的开头片段:
现代软件架构的复杂性需要协同开发完成,如何高效地协同呢?无规矩不成方圆,无规范难以协同,比如,制订交通法规表面上是要限制行车权,实际上是保障公众的人身安全,试想如果没有限速,没有红绿灯,谁还敢上路行</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/CSS%E5%AE%9E%E7%8E%B0%E5%A4%9A%E8%A1%8C%E6%96%87%E6%9C%AC%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5/">CSS实现多行文本溢出省略</a>
<a href="/blog/2020/06/26/CSS%E5%AE%9E%E7%8E%B0%E5%A4%9A%E8%A1%8C%E6%96%87%E6%9C%AC%E6%BA%A2%E5%87%BA%E7%9C%81%E7%95%A5/" class="index-excerpt">
<div>前言多行文本超出高度限制出现省略号 , 移动端多为webkit内核的 , 有扩展属性-webkit-line-clamp , 但并不是CSS规范中的属性 , PC端往往要借助js去实现这一效果,但麻烦且不是很靠谱,今天就用纯CSS来实现一个完全兼容的多行省略。
正文一、webkit内核的实现-webkit-line-clamp设置块元素包含的文本行数;display: -webkit-box设置块</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/BFC%E3%80%81IFC%E3%80%81GFC%E5%92%8CFFC/">BFC、IFC、GFC和FFC</a>
<a href="/blog/2020/06/26/BFC%E3%80%81IFC%E3%80%81GFC%E5%92%8CFFC/" class="index-excerpt">
<div>BFC、IFC、GFC、FFCCSS2.1中只有BFC和IFC, CSS3中才有GFC和FFC。
到底什么是BFC、IFC、GFC和FFC
What’s FC?一定不是KFC,FC的全称是:Formatting Contexts,是W3C CSS2.1规范中的一个概念。它是页面中的一块渲染区域,并且有一套渲染规则,它决定了其子元素将如何定位,以及和其他元素的关系和相互作用。
BFCBFC(Bloc</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/retina%E5%B1%8F%E5%B9%951px%E8%BE%B9%E6%A1%86%E9%97%AE%E9%A2%98/">retina屏幕1px边框问题</a>
<a href="/blog/2020/06/26/retina%E5%B1%8F%E5%B9%951px%E8%BE%B9%E6%A1%86%E9%97%AE%E9%A2%98/" class="index-excerpt">
<div>7 种方法解决移动端 Retina 屏幕 1px 边框问题造成边框变粗的原因其实这个原因很简单,因为css中的1px并不等于移动设备的1px,这些由于不同的手机有不同的像素密度。在window对象中有一个devicePixelRatio属性,他可以反应css中的像素与设备的像素比。
devicePixelRatio的官方的定义为:设备物理像素和设备独立像素的比例,也就是 devicePixelR</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/%E8%A6%86%E7%9B%96%E5%85%83%E7%B4%A0%E5%AE%BD%E5%BA%A6/">覆盖元素宽度</a>
<a href="/blog/2020/06/26/%E8%A6%86%E7%9B%96%E5%85%83%E7%B4%A0%E5%AE%BD%E5%BA%A6/" class="index-excerpt">
<div>在不改变当前代码的情况下,使这张图片的宽度为300px?<img src="1.jpg" style="width:480px!important"/>
1.css方法<img src="1.jpg" style="width:480px!important; max-width: 300px">
<img src="1.jpg" style="width:48</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/opacity_visibility_display%E4%BC%98%E5%8A%A3/">opacity_visibility_display优劣</a>
<a href="/blog/2020/06/26/opacity_visibility_display%E4%BC%98%E5%8A%A3/" class="index-excerpt">
<div>display: none;
DOM 结构:浏览器不会渲染 display 属性为 none 的元素,不占据空间;
事件监听:无法进行 DOM 事件监听;
性能:动态改变此属性时会引起重排,性能较差;
继承:不会被子元素继承,毕竟子类也不会被渲染;
transition:transition 不支持 display。
visibility: hidden;
DOM 结构:元素被隐藏,但是会被渲染</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/DIV%E6%B0%B4%E5%B9%B3%E5%9E%82%E7%9B%B4%E5%B1%85%E4%B8%AD/">DIV水平垂直居中</a>
<a href="/blog/2020/06/26/DIV%E6%B0%B4%E5%B9%B3%E5%9E%82%E7%9B%B4%E5%B1%85%E4%B8%AD/" class="index-excerpt">
<div>div水平垂直居中的方法在平时,我们经常会碰到让一个div框针对某个模块上下左右都居中(水平垂直居中),其实针对这种情况,我们有多种方法实现。
方法一:
绝对定位方法:不确定当前div的宽度和高度,采用 transform: translate(-50%,-50%); 当前div的父级添加相对定位(position: relative;)
图片展示:
代码如下:
div{</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/BFC%E5%8F%8A%E5%85%B6%E5%BA%94%E7%94%A8/">BFC及其应用</a>
<a href="/blog/2020/06/26/BFC%E5%8F%8A%E5%85%B6%E5%BA%94%E7%94%A8/" class="index-excerpt">
<div>一、常见定位方案在讲 BFC 之前,我们先来了解一下常见的定位方案,定位方案是控制元素的布局,有三种常见方案:
普通流 (normal flow)
在普通流中,元素按照其在 HTML 中的先后位置至上而下布局,在这个过程中,行内元素水平排列,直到当行被占满然后换行,块级元素则会被渲染为完整的一个新行,除非另外指定,否则所有元素默认都是普通流定位,也可以说,普通流中元素的位置由该元素在 HTM</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/%E6%8E%A5%E5%8F%A3%E5%A6%82%E4%BD%95%E9%98%B2%E5%88%B7/">接口如何防刷</a>
<a href="/blog/2020/06/26/%E6%8E%A5%E5%8F%A3%E5%A6%82%E4%BD%95%E9%98%B2%E5%88%B7/" class="index-excerpt">
<div>接口如何防刷1:网关控制流量洪峰,对在一个时间段内出现流量异常,可以拒绝请求
2:源ip请求个数限制。对请求来源的ip请求个数做限制
3:http请求头信息校验;(例如host,User-Agent,Referer)
4:对用户唯一身份uid进行限制和校验。例如基本的长度,组合方式,甚至有效性进行判断。或者uid具有一定的时效性
5:前后端协议采用二进制方式进行交互或者协议采用签名机制
6</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<div class="row mx-auto index-card">
<div class="col-12 col-md-12 mx-auto index-info">
<a class="index-header" href="/blog/2020/06/26/HTTP%E5%92%8CHTTPS%E5%8D%8F%E8%AE%AE/">HTTP和HTTPS协议</a>
<a href="/blog/2020/06/26/HTTP%E5%92%8CHTTPS%E5%8D%8F%E8%AE%AE/" class="index-excerpt">
<div>HTTP与HTTPS
一、前言:
先来观察这两张图,第一张访问域名http://www.12306.cn,谷歌浏览器提示不安全链接,</div>
</a>
<div class="index-btm post-metas">
<div class="post-meta mr-3">
<i class="iconfont icon-date"></i> 2020-06-26
</div>
</div>
</div>
</div>
<nav aria-label="navigation">
<span class="pagination" id="pagination">
<span class="page-number current">1</span><a class="page-number" href="/blog/page/2/">2</a><a class="page-number" href="/blog/page/3/">3</a><span class="space">…</span><a class="page-number" href="/blog/page/7/">7</a><a class="extend next" rel="next" href="/blog/page/2/"><i class="iconfont icon-arrowright"></i></a>
</span>
</nav>
<script>
for (ele of document.getElementById("pagination").getElementsByTagName("a")) {
ele.href += '#board';
}
</script>
</div>
</div>
</div>
</div>
</div>
</main>
<a id="scroll-top-button" href="#" role="button">
<i class="iconfont icon-arrowup" aria-hidden="true"></i>
</a>
<div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold">搜索</h4>
<button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-5">
<input type="text" id="local-search-input" class="form-control validate">
<label data-error="x" data-success="v"
for="local-search-input">关键词</label>
</div>
<div class="list-group" id="local-search-result"></div>
</div>
</div>
</div>
</div>
<footer class="mt-5">
<div class="text-center py-3">
<div>
<a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
<i class="iconfont icon-love"></i>
<a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener">
<span>Fluid</span></a>
</div>
</div>
</footer>
<!-- SCRIPTS -->
<script src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script src="/blog/js/debouncer.js" ></script>
<script src="/blog/js/main.js" ></script>
<!-- Plugins -->
<script src="/blog/js/lazyload.js" ></script>
<script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
<script src="/blog/js/clipboard-use.js" ></script>
<script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>
<script src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
<script>
var typed = new Typed('#subtitle', {
strings: [
' ',
"最好的状态是「未来可期」 ",
],
cursorChar: "|",
typeSpeed: 70,
loop: true,
});
typed.stop();
$(document).ready(function () {
$(".typed-cursor").addClass("h2");
typed.start();
});
</script>
<script src="/blog/js/local-search.js" ></script>
<script>
var path = "/blog/local-search.xml";
var inputArea = document.querySelector("#local-search-input");
inputArea.onclick = function () {
searchFunc(path, 'local-search-input', 'local-search-result');
this.onclick = null
}
</script>
<script>
!function (e, t, a) {
function r() {
for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
requestAnimationFrame(r)
}
function n() {
var t = "function" == typeof e.onclick && e.onclick;
e.onclick = function (e) {
t && t(), o(e)
}
}
function o(e) {
var a = t.createElement("div");
a.className = "heart", s.push({
el: a,
x: e.clientX - 5,
y: e.clientY - 5,
scale: 1,
alpha: 1,
color: c()
}), t.body.appendChild(a)
}
function i(e) {
var a = t.createElement("style");
a.type = "text/css";
try {
a.appendChild(t.createTextNode(e))
} catch (t) {
a.styleSheet.cssText = e
}
t.getElementsByTagName("head")[0].appendChild(a)
}
function c() {
return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
}
var s = [];
e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
setTimeout(e, 1e3 / 60)
}, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r()
}(window, document);
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。