【问题标题】:Dreamweaver CSS - Text wont wrapDreamweaver CSS - 文本不会换行
【发布时间】:2012-10-26 13:05:35
【问题描述】:

我正在尝试制作一个简单的网页,但我无法让页面包裹在正文部分、滚动条或没有。页面上的文字不断进入无穷大。 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 的顶部,在它和它上方的顶部导航栏(导航栏)的边界之间。有没有正确的方法来分隔它?在那里放置一个边距只会将 youtube div 进一步向下移动。任何帮助表示赞赏,请随时要求进一步澄清。

【问题讨论】:

    标签: css html tags dreamweaver word-wrap


    【解决方案1】:

    尝试从#body 中删除white-space: nowrap;

    您可以在此处阅读有关 white-space 属性的更多信息:http://www.w3schools.com/cssref/pr_text_white-space.asp

    【讨论】:

    • 请避开 w3schools。最好从W3CMDN 了解它
    猜你喜欢
    • 1970-01-01
    • 2015-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多