1

体の背景が表示されません。30 分前は問題なく動作していましたが、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;
}

誰でも問題はありますか?

4

3 に答える 3

1

次のように書きます -

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

編集:

そこに隠されているに違いない。IDに高さを設定してみてください-

ここをチェックJSFiddle

于 2012-09-25T10:57:15.243 に答える
0

デモ

こんにちはoverflow:hidden;、あなたの#body-1 IDで定義してください

このように

#body-1 {
   overflow:hidden;
 }

ライブデモ

----------------------------

-----------------------

2番目

#body-1:after{
content:'';
  clear:both;
  overflow:hidden;
display:block;
}

ライブデモ

于 2012-09-25T11:22:28.840 に答える
-1

これを試してください

#body-1 {
    width: 870px;
    margin: 0 auto;
    background: #9c0000 url('images/Chinatown-bg.png')  no-repeat 0 0;
}
于 2012-09-25T11:08:09.700 に答える