论坛设置宽版之后,公告跟下面栏目是正常切换,但是头部没变化,请问是什么情况? New
调成宽板之后会出现头部没有跟随的情况,但是其他栏目是正常没问题的
窄版是完全正常的,请问是什么原因导致?需要怎么设置
我知道答案 回答被采纳将会获得1 贡献 已有11人回答 后台更新缓存在试试 非默认模板的话,大概率是模板兼容问题
.ce-block { margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content { /* max-width:calc(100% - 50px) */ margin-left: auto; margin-right: auto;}.ce-paragraph { line-height: 1.6em; outline: none; text-indent: 2em; font-size: 16px;}.ce-paragraph--right { text-align: right;}.ce-paragraph--center { text-align: center;}.ce-paragraph--left { text-align: left;}.ce-paragraph--justify { text-align: justify;}.ce-paragraph-text-indent { text-align: justify;}.ce-paragraph:empty::before{content: attr(data-placeholder);color: #707684;font-weight: normal;opacity: 0;}/** Show placeholder at the first paragraph if Editor is empty */.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {opacity: 1;}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {opacity: 0;}.ce-paragraph p:first-of-type{ margin-top: 0;}.ce-paragraph p:last-of-type{ margin-bottom: 0;}.svg-icon { width: 1em; height: 1em;}.svg-icon path,.svg-icon polygon,.svg-icon rect { fill: #4691f6;}.svg-icon circle { stroke: #4691f6; stroke-width: 1;}.inline-code {background: rgba(250, 239, 240, 0.78);color: #b44437;padding: 3px 4px;border-radius: 5px;margin: 0 1px;font-family: inherit;font-size: 0.86em;font-weight: 500;letter-spacing: 0.3px;} 已经更新过缓存 还是不行,基本静态HTML的代码 了一部分是CSS冲突 还是代码问题? - -我首页就时增加了 广告用了静态HTML <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body {
background: #f5f7fa;
color: #333;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
}
.container {
width: 100%;
max-width: 1200px;
}
header {
text-align: center;
margin-bottom: 40px;
}
header h1 {
font-size: 2.2rem;
margin-bottom: 15px;
color: #2c3e50;
}
header p {
font-size: 1.1rem;
max-width: 700px;
margin: 0 auto;
line-height: 1.6;
color: #7f8c8d;
}
.notice-container {
width: 100%;
border-radius: 12px;
overflow: hidden;
margin-bottom: 40px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
background: white;
border: 1px solid #e0e0e0;
}
.notice-board {
height: 220px;
overflow: hidden;
position: relative;
}
.notice-list {
list-style: none;
position: relative;
transition: transform 0.5s ease-in-out;
}
.notice-list li {
height: 220px;
display: flex;
flex-direction: column;
justify-content: center;
padding: 20px 25px;
border-bottom: 1px solid #f0f0f0;
transition: background 0.3s;
}
.notice-list li:hover {
background: #f9f9f9;
}
.notice-title {
font-size: 1.2rem;
font-weight: bold;
color: #2c3e50;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 10px;
}
.notice-title i {
color: #3498db;
}
.notice-content {
color: #555;
line-height: 1.6;
margin-bottom: 12px;
}
.notice-date {
color: #888;
font-size: 0.85rem;
display: flex;
align-items: center;
gap: 8px;
}
.notice-indicators {
display: flex;
justify-content: center;
padding: 15px;
background: #f8f9fa;
border-top: 1px solid #eee;
}
.indicator {
width: 10px;
height: 10px;
border-radius: 50%;
background: #ddd;
margin: 0 5px;
cursor: pointer;
transition: all 0.3s;
}
.indicator.active {
background: #3498db;
transform: scale(1.2);
}
.new {
background: #f0f8ff;
border-left: 4px solid #3498db;
}
.demo-section {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-top: 30px;
}
.demo-box {
background: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
.demo-box h3 {
color: #2c3e50;
margin-bottom: 15px;
display: flex;
align-items: center;
gap: 10px;
}
.demo-box p {
color: #555;
line-height: 1.6;
}
footer {
margin-top: 50px;
text-align: center;
color: #7f8c8d;
padding: 20px;
font-size: 0.9rem;
width: 100%;
}
/* 响应式设计 */
@media (max-width: 768px) {
header h1 {
font-size: 1.8rem;
}
.notice-board {
height: 200px;
}
.notice-list li {
height: 200px;
padding: 18px 20px;
}
.notice-title {
font-size: 1.1rem;
}
}
@media (max-width: 480px) {
header h1 {
font-size: 1.6rem;
}
.notice-board {
height: 180px;
}
.notice-list li {
height: 180px;
padding: 15px;
}
.notice-title {
font-size: 1rem;
}
.notice-content {
font-size: 0.9rem;
}
}
</style>
<div class="container">
<div class="notice-container">
<div class="notice-board">
<ul class="notice-list" id="noticeList">
<li >
<div class="notice-title"></i> 系统维护通知</div>
<div class="notice-content">为了提供更优质的服务,我们将在本周六凌晨2:00-6:00进行系统维护,期间服务将短暂不可用。</div>
<div class="notice-date"><i class="far fa-clock"></i> 2023-10-15</div>
</li>
<li>
<div class="notice-title"><i class="fas fa-star"></i> 新功能上线</div>
<div class="notice-content">我们很高兴地宣布,新版用户中心已上线,新增多项实用功能,欢迎体验并提供宝贵意见。</div>
<div class="notice-date"><i class="far fa-clock"></i> 2023-10-12</div>
</li>
<li>
<div class="notice-title"><i class="fas fa-flag"></i> 国庆节假期安排</div>
<div class="notice-content">根据国家法定节假日安排,我们的客服中心将于10月1日至10月7日放假,10月8日恢复正常服务。</div>
<div class="notice-date"><i class="far fa-clock"></i> 2023-09-28</div>
</li>
<li>
<div class="notice-title"><i class="fas fa-shield-alt"></i> 安全提醒</div>
<div class="notice-content">近期发现有不法分子冒充我司工作人员进行诈骗,请各位用户提高警惕,谨防上当受骗。</div>
<div class="notice-date"><i class="far fa-clock"></i> 2023-09-25</div>
</li>
<li>
<div class="notice-title"><i class="fas fa-sync-alt"></i> 产品更新日志</div>
<div class="notice-content">本次更新修复了已知的3个问题,优化了系统性能,提升了用户体验。详细更新内容请查看更新日志。</div>
<div class="notice-date"><i class="far fa-clock"></i> 2023-09-20</div>
</li>
</ul>
</div>
<div class="notice-indicators" id="indicators">
<!-- 指示器将由JS动态生成 -->
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const noticeList = document.getElementById('noticeList');
const indicatorsContainer = document.getElementById('indicators');
const notices = noticeList.querySelectorAll('li');
const noticeCount = notices.length;
// 动态获取公告高度
let noticeHeight = notices ? notices.offsetHeight : 220;
let currentIndex = 0;
let autoScrollInterval;
// 初始化指示器
function initIndicators() {
indicatorsContainer.innerHTML = '';
for (let i = 0; i < noticeCount; i++) {
const indicator = document.createElement('div');
indicator.className = 'indicator';
if (i === currentIndex) {
indicator.classList.add('active');
}
indicator.addEventListener('click', () => {
goToNotice(i);
});
indicatorsContainer.appendChild(indicator);
}
}
// 更新指示器状态
function updateIndicators() {
const indicators = document.querySelectorAll('.indicator');
indicators.forEach((indicator, index) => {
if (index === currentIndex) {
indicator.classList.add('active');
} else {
indicator.classList.remove('active');
}
});
}
// 滚动到指定公告
function goToNotice(index) {
currentIndex = index;
const translateY = -currentIndex * noticeHeight;
noticeList.style.transform = `translateY(${translateY}px)`;
updateIndicators();
}
// 滚动到下一条公告
function nextNotice() {
currentIndex = (currentIndex + 1) % noticeCount;
goToNotice(currentIndex);
}
// 开始自动滚动
function startAutoScroll() {
autoScrollInterval = setInterval(() => {
nextNotice();
}, 4000);
}
// 鼠标悬停时暂停自动滚动
noticeList.addEventListener('mouseenter', () => {
clearInterval(autoScrollInterval);
});
// 鼠标离开时恢复自动滚动
noticeList.addEventListener('mouseleave', () => {
startAutoScroll();
});
// 窗口大小变化时重新计算高度
window.addEventListener('resize', () => {
const newHeight = notices ? notices.offsetHeight : 220;
if (newHeight !== noticeHeight) {
noticeHeight = newHeight;
goToNotice(currentIndex); // 重新定位当前公告
}
});
// 初始化
if (noticeCount > 0) {
initIndicators();
startAutoScroll();
}
});
</script>
刚刚用了默认模板还是出现同样的问题 我添加的静态公告代码是这样子的 你自己加的这个代码里就有限制头部最大宽度的样式定义,所以你自己这段代码造成的 - -尝试了 把这整个代码都删除了 然后更新缓存 还是不行 同样的老问题 你大概率还有其他代码限制呗,DZ标准产品是肯定没问题的,与其在这猜,你不如直接放出地址更实际 - -因为是局域网没放出来 所以发不了
页:
[1]