2012-10-26 23 views
2

我想做一個簡單的網頁,但我不能讓頁面包裹在正文部分,滾動條或不。頁面上的文字不斷進入無限。 CSS的表如下:Dreamweaver CSS - 文本不會換行

@charset "utf-8"; 

*{ 
background-color:#CCC; 
margin:0; 
padding:0; 
} 

body { 
    font-family: Verdana, Geneva, sans-serif; 
    font-size: 15px; 
    font-style: normal; 
    color: #609; 
    text-align:left; 
} 

#container 
{ 
    margin-left:auto; 
    margin-right:auto; 
    background-color: #CCC; 
    height: 768px; 
    width: 1366px; 
    border: thin solid #FFF; 
} 

#header 
{ 
    height: 50px; 
    width: 1214px; 
    border-bottom-width: thin; 
    border-bottom-style: solid; 
    border-bottom-color: #FFF; 
    clear: right; 
    float: right; 
    border-right-width: thin; 
    border-right-style: solid; 
    border-right-color: #FFF; 
} 

#sitelogo 
{ 
    float: left; 
    height: 101px; 
    width: 150px; 
    border-bottom-width: thin; 
    border-bottom-style: solid; 
    border-right-color: #FFF; 
    border-bottom-color: #FFF; 
    border-left-color: #FFF; 
    border-right-width: thin; 
    border-right-style: solid; 
    border-top-color: #FFF; 
} 

#lrftnavbar 
{ 
    clear:both ; 
    float: left; 
    height: 616px; 
    width: 150px; 
    border-right-width: thin; 
    border-right-style: solid; 
    border-right-color: #FFF; 
} 

#navbar 
{ 
    float: right; 
    height: 50px; 
    width: 1214px; 
    border-bottom-width: thin; 
    border-bottom-style: solid; 
    border-bottom-color: #FFF; 
    border-right-width: thin; 
    border-right-style: solid; 
    border-right-color: #FFF; 
} 

#footer 
{ 
    clear: both; 
    float: left; 
    height: 50px; 
    width: 1353px; 
    border-top-width: thin; 
    border-top-style: solid; 
    border-top-color: #FFF; 
} 

#body 
{ 
    background-color: #CCC; 
    height: 610px; 
    width: 1180px; 
    white-space: nowrap; 
    overflow: scroll; 
    float: left; 
    clear: none; 
    padding: 15px; 
    margin:auto; 
} 

.new 
{ 
    font-size: 9px; 
    font-style: italic; 
    color: #630; 
    background-color: #0FF; 

} 

#utube 
{ 
    background-color: #CCC; 
    float: left; 
    height: 240px; 
    width: 320px; 
    border: thin solid #FFF; 
    margin-top: 0px; 
    margin-right: 15px; 
    margin-bottom: 15px; 
    margin-left: 0px; 
} 

我放到HTML #body DIV內容不斷持續,儘管容器不會去到下一行。此外,文本會在youtube div的頂部,位於它與頂部導航欄(navbar)的邊界之上。有沒有一種正確的方法來隔離它?在那裏放一個保證金只會將YouTube的div進一步下移。任何幫助表示感謝,請隨時要求進一步澄清。

回答

1

嘗試從#body中刪除white-space: nowrap;

你可以閱讀更多關於這裏的white-space屬性:http://www.w3schools.com/cssref/pr_text_white-space.asp

+1

請避免W3Schools的。最好從[W3C](http://www.w3.org/TR/CSS2/text.html#propdef-white-space)或[MDN](https://developer.mozilla.org/en -US /文檔/ CSS /空格) –