Html 更改外部SS后背景消失
我创建的页面似乎有问题Html 更改外部SS后背景消失,html,css,background,external,Html,Css,Background,External,我创建的页面似乎有问题 我用在内部编写了CSS代码。您需要更新CSS文件中的图像文件夹路径,以便它能够对应CSS文件路径 像这样试试 #pageBody { background: url('../img/pageBg.png') no-repeat; . . } 或 你可以简单地将CSS文件放在HTML文件旁边,而不是放在新文件夹中我会给你投票,但我没有足够的代表。谢谢!我真是太傻了,为了进入images文件夹,我不得不建立一个目录,因为它与我的CSS不在同一个文
我用
在内部编写了CSS代码。您需要更新CSS文件中的图像文件夹路径,以便它能够对应CSS文件路径
像这样试试
#pageBody {
background: url('../img/pageBg.png') no-repeat;
.
.
}
或
你可以简单地将CSS文件放在HTML文件旁边,而不是放在新文件夹中我会给你投票,但我没有足够的代表。谢谢!我真是太傻了,为了进入images文件夹,我不得不建立一个目录,因为它与我的CSS不在同一个文件夹中。谢谢你的建议!我将把CSS和我的index.html放在同一个目录中:)谢谢:)。。我和你一样还是一个堆栈溢出的初学者。很好!不管你是不是初学者,你刚刚解决了我的简单难题呵呵:)
/* CSS Document */
/*
BACKGROUND (pic and font)
*/
body {
background: url('img/wallpaper.png') no-repeat scroll center;
font-family: Arial, Helvetica, sans-serif;
margin-left: 66px;
margin-right: 66px;
}
/* THE PAGE BODY */
#pageBody {
background: url('img/pageBg.png') no-repeat;
width: 913px;
margin: 0 auto;
}
/* THE LOGO */
#pageBody #header .logo {
padding: 46px 629px 22px 50px;
}
/*** THE FORM AND IT'S INPUTS ***/
#header {
position: relative;
}
#header form input[type="search"] {
background: url('img/searchBgWide.png') center repeat-x;
border: none;
width: 282px;
height: 34px;
padding-left: 10px;
font-weight: bold;
font-style: italic;
position: absolute;
top: 18px;
right: 59px;
}
#header form {
position: absolute;
top: 45px;
right: 45px;
}
/*** THE NAVIGATION MENU ***/
nav table {
width: 100%;
height: 51px;
border-collapse: collapse;
}
nav table tr .menuItem {
line-height: 51px;
background: url('img/MenuBg.png');
text-align: center;
}
nav table tr .menuSep {
background: url('img/MenuSeparator.png');
width: 5px;
height: 51px;
}
nav table tr a {
text-decoration: none;
color: #ececec;
font-weight: bold;
font-size: 91%;
}
/* --END OF NAVIGATION MENU-- */
/* **CONTENT** */
#content {
position: relative;
}
/* SIDEBAR no.1 */
#content aside .box1 {
width: 234px;
height: 228px;
background: url('img/tripsBg.png') no-repeat;
padding: 17px 0 0 16px;
margin: 31px 0 20px 31px;
line-height: 0.9;
position: relative;
}
#content aside .box1 .tripText {
position: absolute;
top: 50px;
right: 0;
width: 135px;
padding: 0 37px 33px 10px;
color: #fff;
}
/* Font styles & sizes */
#content aside .box1 h3 {
font-size: 90%;
}
#content aside .box1 h3:first-of-type {
color: #fff;
opacity: 0.8;
}
#content aside .box1 h3:last-of-type {
color: #c07644;
opacity: 0.8;
}
#content aside .box1 .tripText {
font-size: 90%;
}
#content aside .box1 .tripText h4 {
color: #ff9127;
}
/* --END OF FONT STYLES-- */
/* SIDEBAR no.2 */
#content aside .box2 {
width: 234px;
height: 228px;
background-color: #5b8e1b;
padding: 17px 0 0 16px;
margin: 31px 0 20px 31px;
line-height: 0.9;
position: relative;
border-radius: 5px 5px;
}
#content aside .box2 h3 {
font-size: 90%;
}
/* --END OF SIDE BAR-- */
/* **Article section** */
article {
position: absolute;
top: 10px;
right: 10px;
width: 590px;
color: #e9e9e9;
}
#content aside article p {
font-size: 80%;
}
/* --END OF ARTICLE SECTION-- */
/* **Footer section** */
/* --END OF FOOTER-- */
#pageBody {
background: url('../img/pageBg.png') no-repeat;
.
.
}