JClockH xc(讨论 | 贡献) 小无编辑摘要 |
JClockH xc(讨论 | 贡献) 小无编辑摘要 |
||
| (未显示同一用户的5个中间版本) | |||
| 第4行: | 第4行: | ||
var newDiv = document.createElement('div'); | var newDiv = document.createElement('div'); | ||
newDiv.setAttribute('class', 'header-img'); | newDiv.setAttribute('class', 'header-img'); | ||
newDiv.innerHTML = '<div class="header-img" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent | newDiv.innerHTML = '<div class="header-img" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent 100%), url(mainpage2.jpg);background-size: cover;background-position: center center;height: 54vh;margin-bottom: -72vh;"></div>'; | ||
mwBody.parentNode.insertBefore(newDiv, mwBody); | mwBody.parentNode.insertBefore(newDiv, mwBody); | ||
} | } | ||
2023年10月6日 (五) 22:39的最新版本
var page = document.querySelector("body");
if (page.classList.contains('page-首页')) {
var mwBody = document.getElementById('content');
var newDiv = document.createElement('div');
newDiv.setAttribute('class', 'header-img');
newDiv.innerHTML = '<div class="header-img" style="background-image: linear-gradient(to top, var(--color-surface-0), transparent 100%), url(mainpage2.jpg);background-size: cover;background-position: center center;height: 54vh;margin-bottom: -72vh;"></div>';
mwBody.parentNode.insertBefore(newDiv, mwBody);
}