English 中文(简体)
侧巴和集装箱码头
原标题:Sidebar and Container width CSS problem

I have a simple page for a chat system. Test page can be found here: http://komasurfer.com/chat-test/

该法典:

<html>
<head>
<style type="text/css">
#page-wrap {
  margin-top: 10px;
  margin-bottom: 10px;
  width: 100%;

  /*for sidebar*/
  margin-right: -110px;
  background-color: #AAAAFF;
}

#chat-wrap {
  border: 1px solid #eee;
  margin: 0 5px 10px 0;
  float: left;

  /*margin for sidebar*/
    margin-right:115px;

  border: 1px solid red;
  background-color: #600000; }

#chat-area {

  width:100%;
  height: 400px;
  border: 1px solid #666;
  float: left;
}

#sidebar {
  border: 1px solid green;
  float: right;
  width: 110px;
  padding: 0px 0px 0px 5px;
}

#entry {
  background-color: #ffffff;
  padding: 5px;
  font-size: 1em;
  clear: both;
  border: 3px solid #999;
  height: 40px;
  width: 97%; }
#entry-btn {
  padding: 18px;
  float: right; }

.left {float: left; }
.right {float: right; }
.c {clear: both; }
</style>

</head>
<body>

<div id="page-wrap">

    <div id="sidebar">
            SIDEBAR
    </div>

    <div id="chat-wrap">

        <div id="chat-area">

            <div id="loading">connecting to server...</div>

        </div>

    </div>

    <div class="c"></div>

    <form id="send-message-area">
        <div>
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tbody><tr><td align="left" width="98%" style="padding-right:5px;">
                <textarea tabindex="1" maxlength="2000" id="entry"></textarea>
            </td><td align="right">
                <input id="entry-btn" type="button" value="Send">
            </td></tr></tbody></table>
        </div>
    </form>

</div>

</body>
</html>

I ve been trying for a very long time now to get the red box (with the contents of the chat) to expand to the sidebar. If I add a width of 100% to that box, it always disregards the margin that I set for the sidebar and expands to the width of the container box.

www.un.org/Depts/DGACM/index_spanish.htm 我怎么能够把红聊天区扩大到旁边带(湿度为5皮克)。

布局是浮动的,因此我无法进行绝对测量。 旁边应当为110个餐厅。

最佳回答

移除浮体:从聊天-重塑中抽取,增加适当幅度,如:

#chat-wrap {
    background-color: #600000;
    border: 1px solid red;
    margin: 0 136px 10px 0;
}
问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签