css控制div的子元素不换行

it2024-01-26  66

需求:如题:

<div style="white-space:nowrap"> <input type='text' style="display:inline;width:180px;" ></input> <button type="button" class="btn btn-default">确定</button> </div>

如上代码中,在父的div中设置属性

white-space:nowrap

然后在子元素中添加属性:

display:inline;

 

最新回复(0)