Frontend
Development
& Succulent
-
解决锚定位被fixed遮挡
Apr 05, 2021需求:锚定位元素跳转后会到达视口顶部时,不让fixed布局的导航栏遮挡
HTML
<header></header> <a id="anchor"></a>
CSS
header{ position: fixed; top: 0; left: 0; z-index: 9; width:100%; height: 60px; } #anchor { display: block; position: relative; top: -60px; visibility: hidden; }
-
获取URL中的锚
Mar 16, 2021需求:跨页面跳转到锚点定位,并给锚点元素添加点击事件,用于跳转后自动展开手风琴。
实现:
location.hash
获取URL中锚部分,然后模拟一个点击事件。var urlHash = window.location.hash; if (urlHash.length > 0) { document.getElementById(urlHash).click(); }
-
Jekyll Notes
Dec 28, 2020Create a new Jekyll site scaffold in PATH
jekyll new
Change into your new directory
cd new-site
Change Gemfile and _config.yml, run
Read morebundle install
-
Markdown Notes
Dec 20, 2020Headers
# This is an h1 ## This is an h2 ### This is an h3 #### This is an h4 ##### This is an h5 ###### This is an h6
Horizontal line:
---
break
2 spaces
italic
_italic_
or*italic*
bold
__bold__
or**bold**
img
![alt](https://example.jpg)
link
Read more[link](https://example.com/)
or[link](https://example.com/){:target="_blank"}
-
买钻戒的技巧
Oct 13, 2020钻戒分品牌,品牌档次不同,价格会有所不同(品牌价值+工艺精湛+售后服务)大品牌的制作工艺更好,做出来的戒托能够很好体现出钻石的亮度和火彩,钻戒看起来会更闪亮。
钻石是天然的,不分品牌,钻石的品质只与钻石4C等级有关(克拉重量Carat、颜色Color、净度Clarity、切工Cut)。
非专业人士加上无专业设备,一般人很难直接鉴别钻石的品质优劣,这时候就需要查看钻石的鉴定证书。
Read more