1

我的布局中有一张桌子。我也在使用引导程序的响应式设计。
我想知道如何根据我正在使用的设备扩展其宽度。

例如,在我的电脑上,我的网站通常以大约 1200 像素的宽度显示。
在我的 iPhone 上,我的网站通常以大约 640 像素的分辨率显示。

我想尽可能地扩大气泡的宽度(我的意思是 100% 宽度) 气泡的宽度应该是灵活的。缩小窗口的宽度应使其自动调整大小。

我怎样才能?

演示 http://jsfiddle.net/8ASj4/

HTML

<div class="chat">

<table>
  <tbody>
     <tr>
               <th>Body</th>
     </tr>



    <tr id="comment_617">
            <td><div class="bubble me"><span class="text-error">01-10 03:29</span>:Person A<br>
            bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
            <form action="/shop/walmart/posts/617" class="button_to" data-remote="true" method="post"><div><input name="_method" value="delete" type="hidden"><input data-confirm="Are you sure?" data-disable-with="deleting..." value="destroy" type="submit"><input name="authenticity_token" value="aoLKQnl4M2SWVlOrXGR+qIMLSeY5m1tKiC/PSnYQjmw=" type="hidden"></div></form>
            </div></td>
    </tr>




    <tr id="comment_615">
            <td><div class="bubble me"><span class="text-error">01-10 03:25</span>:Person A<br>
            bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
            <form action="/shop/walmart/posts/615" class="button_to" data-remote="true" method="post"><div><input name="_method" value="delete" type="hidden"><input data-confirm="Are you sure?" data-disable-with="deleting..." value="destroy" type="submit"><input name="authenticity_token" value="aoLKQnl4M2SWVlOrXGR+qIMLSeY5m1tKiC/PSnYQjmw=" type="hidden"></div></form>
            </div></td>
    </tr>
</tbody>

 <div>

CSS

.chat {
    width: 100%;
    min-width: 300px;
}

.bubble{
    background-color: #FFFFFF;
    border-radius: 5px;
    box-shadow: 0 0 6px #B2B2B2;
    display: inline-block;
    padding: 10px 18px;
    position: relative;
    vertical-align: top;
    word-break: break-all;
}

.bubble::before {
    background-color: #FFFFFF;
    content: "\00a0";
    display: block;
    height: 16px;
    position: absolute;
    top: 11px;
    transform:             rotate( 29deg ) skew( -35deg );
        -moz-transform:    rotate( 29deg ) skew( -35deg );
        -ms-transform:     rotate( 29deg ) skew( -35deg );
        -o-transform:      rotate( 29deg ) skew( -35deg );
        -webkit-transform: rotate( 29deg ) skew( -35deg );
    width:  20px;
}

.me {
    float: left;   
    margin: 5px 45px 5px 5px;
    min-width: 250px; 
    width: 100%;      
}

.me::before {
    box-shadow: -2px 2px 2px 0 rgba( 178, 178, 178, .4 );
    left: -9px;           
}

.you {
    float: left;    
    margin: 5px 10px 5px 5px;
    min-width: 250px;
    width: 100%;          
}

.you::before {
    box-shadow: 2px -2px 2px 0 rgba( 178, 178, 178, .4 );
    right: -9px;    
}
4

1 回答 1

1

只需删除所有与表格相关的标签(table/td/tr/etc.)

<div class="chat">

<div class="bubble me"><span class="text-error">01-10 03:29</span>:Person A<br>
            bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
            <form action="/shop/walmart/posts/617" class="button_to" data-remote="true" method="post"><div><input name="_method" value="delete" type="hidden"><input data-confirm="Are you sure?" data-disable-with="deleting..." value="destroy" type="submit"><input name="authenticity_token" value="aoLKQnl4M2SWVlOrXGR+qIMLSeY5m1tKiC/PSnYQjmw=" type="hidden"></div></form>
            </div>

              <div class="bubble me"><span class="text-error">01-10 03:25</span>:Person A<br>
            bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
            <form action="/shop/walmart/posts/615" class="button_to" data-remote="true" method="post"><div><input name="_method" value="delete" type="hidden"><input data-confirm="Are you sure?" data-disable-with="deleting..." value="destroy" type="submit"><input name="authenticity_token" value="aoLKQnl4M2SWVlOrXGR+qIMLSeY5m1tKiC/PSnYQjmw=" type="hidden"></div></form>
            </div>

 <div>

http://jsfiddle.net/8ASj4/2/

于 2013-01-10T19:38:32.810 回答