注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:按 Ctrl-F5。
$(function(){
/* 头图 */
var page = document.querySelector("body");
if (page.classList.contains('page-首页')) {
var mwBody = document.getElementById('content');
var newDiv = document.createElement('div');
newDiv.setAttribute('class', 'header-image');
newDiv.innerHTML = '<div class="header-image" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent 150%), url(https://image.knebulae.com/data/lnl.png);background-size: cover;background-position: top;height: 36vh;margin-bottom: -35vh;"></div>';
mwBody.parentNode.insertBefore(newDiv, mwBody);
}
}());