这是我的Github存储库:https://github.com/Yicheng-1218/OceanCrisis
我有一个问题,为什么标题中的样式会自动更改为无?
我使用main.css将标题的背景图像更改为其他图像,但它不起作用。
index.html:
<div id="header">
<!-- Inner -->
<div class="inner">
<header>
<h1><a href="index.html" id="logo">OceanCrisis</a></h1>
<hr>
<p>海洋危機</p>
</header>
<footer>
<a href="#main" class="button circled scrolly">閱讀</a>
</footer>
</div>
<!-- Nav -->
<nav id="nav">
<ul>
<li style="white-space: nowrap;"><a href="index.html">首頁</a></li>
<li style="white-space: nowrap;"><a href="#banner" class="scrolly">公益活動</a></li>
<li style="white-space: nowrap;"><a href="#features" class="scrolly">生態危機</a></li>
<li style="white-space: nowrap;"><a href="#footer" class="scrolly">關於</a></li>
</ul>
</nav>
</div>
这是github页面显示的:
<div id="header" bis_skin_checked="1" style="background-image: none;">
<!-- Inner -->
<div class="inner" bis_skin_checked="1">
<header>
<h1><a href="index.html" id="logo" bis_skin_checked="1">OceanCrisis</a></h1>
<hr>
<p>海洋危機</p>
</header>
<footer>
<a href="#main" class="button circled scrolly" bis_skin_checked="1">閱讀</a>
</footer>
</div>
<!-- Nav -->
<nav id="nav">
<ul>
<li style="white-space: nowrap;"><a href="index.html" bis_skin_checked="1">首頁</a></li>
<li style="white-space: nowrap;"><a href="#banner" class="scrolly" bis_skin_checked="1">公益活動</a></li>
<li style="white-space: nowrap;"><a href="#features" class="scrolly" bis_skin_checked="1">生態危機</a></li>
<li style="white-space: nowrap;"><a href="#footer" class="scrolly" bis_skin_checked="1">關於</a></li>
</ul>
</nav>
</div>
main.css
/* Header */
#header {
position: relative;
background-image: url("../images/114645.jpg");
background-size: cover;
background-position: center center;
background-attachment: fixed;
color: #fff;
text-align: center;
padding: 7.5em 0 2em 0;
cursor: default;
}
发布于 2022-06-09 06:50:46
#header {
position: relative;
background-image: url("./static/images/114645.jpg");
background-size: cover;
background-position: center center;
background-attachment: fixed;
color: #fff;
text-align: center;
padding: 7.5em 0 2em 0;
cursor: default;
}
or
#header {
position: relative;
background-image: url("static/images/114645.jpg");
background-size: cover;
background-position: center center;
background-attachment: fixed;
color: #fff;
text-align: center;
padding: 7.5em 0 2em 0;
cursor: default;
}
你的directory structure
:-
project > static >
| |- > css > main.css
| | |- other css file
| |- > images > 114645.jpg
| |- etc. images
|
|- index.html
|- etc. file
如果您想要访问而不是使用static/images/114645.jpg
或./static/images/114645.jpg"
,则
https://stackoverflow.com/questions/72555564
复制相似问题