网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 html中div不自动换行强制不换行的具体实现
范文
    1.用<nobr>标签实现不换行
    代码如下:
    <div>hello world!<nobr> hello world!<nobr></div>
    2.用<用nowrap元素>标签
    代码如下:
    <div nowrap>hello world! hello world! hello world! hello world!</div>
    3强制不换行
    代码如下:
    div{
    white-space:nowrap;
    }
    4.如果是两个div,可使用float实现不换行
    代码如下:
    div class=class1>hello </div>
    <div class=class2>world! </div>
    .class1 {float:left;}
    5.在div中也可使用display实现不换行
    代码如下:
    <div class=class1>hello </div>
    <div class=class2>world! </div>
    .class1 {display:inline;}
    .class2{display:inline;}
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/21 19:18:12