更新时间:2023-02-14 18:11:11
您只需要浮动左元素.
HTML
<div id="left">Hello yoyoyoy jrllo hello blah blah</div>
<div id="right"></div>
CSS
#left,#right{
height:50px;
}
#left{
background:red;
float:left;
}
#right{
background:green;
}
https://jsfiddle.net/qb3374ou/
右div与内容..相同的结果 https://jsfiddle.net/qb3374ou/1/
right div with content.. same result https://jsfiddle.net/qb3374ou/1/