gpt4 book ai didi

html - 背景图不显示

转载 作者:太空宇宙 更新时间:2023-11-03 18:59:21 25 4
gpt4 key购买 nike

我的 body 背景没有显示。半小时前它工作正常,我不明白为什么它在 IE 9 或 Chrome 中不显示。它在 Expression Web 4 的预览中显示良好。

它应该看起来像这样 >> http://imageshack.us/photo/my-images/31/screenshotlrj.jpg/

HTML代码:

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Chinatown</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="body-1">
<div id="header">
<img height="315" src="images/Chinatown-header.png" width="850" />
</div>
<div id="title-1">
<p>We is pleased to announce the launch of our Social Enterprise - Experience Chinatown</p>
</div>
<div id="maindescription-1">
<p>RTE are conducting unique tours to celebrate Chinatown, the beating heart of our culture in. We will be
taking people on a journey through Chinatown on a guided tour about the stories of the locals and pioneers that
made Chinatown what it is today, and then expanding the experiences with tasting tours of the variety of delicious cuisines
on offer. Please see below for more information:</p>
</div>
</div>
</body>
</html>

CSS:

html,
body {
margin:0;
padding:0;
color:#000;
background: #9c0000;
}
p {
margin : 0;
padding : 0;
}
#body-1 {
width: 870px;
margin: 0 auto;
background: #9c0000;
background-image: url('images/Chinatown-bg.png');
}
#header {
padding:10px;
background:#bc0000;
}
#title-1 {
font: normal normal bold 100% "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
float: left;
width: 850px;
padding: 0 10px 10px 10px;
color: #FFFF00;
text-align: justify;
vertical-align: top;
}
#maindescription-1 {
font: 100% "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
float: left;
width: 850px;
padding: 0 10px 10px 10px;
color: #FFFFFF;
text-align: justify;
vertical-align: top;
}

有人发现它有什么问题吗?

最佳答案

写成-

#body-1 {
width: 870px; height: 500px;
margin: 0 auto;
background: url('images/Chinatown-bg.png') #9c0000 no-repeat left top;
}

编辑:

它肯定藏在那里。尝试为 ID 设置一些高度 -

在这里查看 JSFiddle

关于html - 背景图不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12581308/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com