Github页面背景图像更改为无



这是我的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;
}
#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;
}

yourdirectory 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

最新更新