If placing an absolute position with left:100%, the DIV will not reserve the normal width depending on its content. Instead, the width will be minimized by breaking the text over spaces.

如果放置一个左边的绝对位置:100%,DIV将不会保留正常宽度,具体取决于其内容。相反,通过在空格上打破文本来最小化宽度。

Here is a simple EXAMPLE

这是一个简单的例子

How is it possible to place an absolute position with left:100% (which is located just outside the parent), but keeping the DIV content (text) in one line.

如何用左边放置绝对位置:100%(位于父节点之外),但将DIV内容(文本)保持在一行中。

Note that the text length and DIV width are unknown, as the width must be set according to the inner content.

请注意,文本长度和DIV宽度是未知的,因为必须根据内部内容设置宽度。

2 个解决方案

#1


3

If all you want is for your absolute div to have his text on one line you can put:

如果你想要的只是你的绝对div将他的文字放在一行上你可以放:

white-space:nowrap;

jsFiddle

Is this what you're after?

这就是你要追求的吗?

更多相关文章

  1. DiggBar如何基于不在其域上的内容动态调整其iframe的高度?
  2. IE-7 z-index问题-下拉区域在横幅下,它的内容没有显示在IE-7中。
  3. PHP选择具有特定宽度的图像并构建网格
  4. 提交一个表单(后台生成id),点击保存并一步后切换到下一个tab中,此t
  5. 在Paragraphs中显示mysql内容时出现问题
  6. thinkphp5使用workerman定时器定时爬取某站点新闻资讯等内容
  7. PHP调用内容DES加密的SOAP接口
  8. PHP限制HTML内容中图片必须是本站的方法
  9. 将Ajax div内容存储在PHP变量中

随机推荐

  1. Android开发者e周报 第6期
  2. android车载娱乐系统跟android平板的分析
  3. Android中自定义控件
  4. Missing styles. Is the correct theme c
  5. Android的Window类详解
  6. IBM谷歌等工程师撰写Android开发教程合集
  7. 打造android ORM框架opendroid(一)——OR
  8. Android API Guides---Web Apps
  9. Android Tool——Hierachy Viewer可视化
  10. 阅读《Android(安卓)从入门到精通》(9)——