标题 | 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;} |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。