zoukankan      html  css  js  c++  java
  • 子元素相对父元素定位(子绝父相)后,子元素根据其内容自动撑开宽度,怎么做呢?

                  position: absolute;
                  //  460px;
                  white-space: nowrap;

    设置一下  white-space: nowrap;  就可以啦~~

     white-space 属性设置如何处理元素内的空白。

    所有浏览器都支持 white-space 属性。

    注释:任何的版本的 Internet Explorer (包括 IE8)都不支持属性值 "inherit"。

    描述
    normal 默认。空白会被浏览器忽略。
    pre 空白会被浏览器保留。其行为方式类似 HTML 中的 <pre> 标签。
    nowrap 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。
    pre-wrap 保留空白符序列,但是正常地进行换行。
    pre-line 合并空白符序列,但是保留换行符。
    inherit 规定应该从父元素继承 white-space 属性的值。

    word-break 属性规定自动换行的处理方法。

    所有主流浏览器都支持 word-break 属性。

    描述
    normal 使用浏览器默认的换行规则。
    break-all 允许在单词内换行。
    keep-all 只能在半角空格或连字符处换行。
  • 相关阅读:
    linux(centos)搭建SVN服务器
    应该具备的能力
    Oracle trunc()函数的用法
    Realistic View for Autodesk Revit 2021
    Snowman
    A Material-Texture Painting Tool
    A Color Picker based on manifold learning
    CPU Path Tracing Renderer
    Rig Space FEM Simulation
    MPM Snow Simulation
  • 原文地址:https://www.cnblogs.com/ordinary-yolanda/p/14154147.html
Copyright © 2011-2022 走看看