nowrap

CSS nowrap for other than text elements?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 23:52:23
Is there a way to avoid wrapping of a div 's content when the content is not just text e.g. several buttons? sachleen white-space:nowrap; should do the trick. #foo { white-space:nowrap; width: 100px; } <div id="foo"> <input type="button" value="hello"/> <input type="button" value="hello"/> <input type="button" value="hello"/> <input type="button" value="hello"/> <input type="button" value="hello"/> <input type="button" value="hello"/> <input type="button" value="hello"/> </div> Demo You can set both these properties in CSS: white-space:nowrap; and max-width:something; You can declare static

  vs white-space:nowrap

核能气质少年 提交于 2019-12-04 21:02:11
问题 I will admit that I have a habit of using   between words when I don't want them to break (table headers for example). Should I really style my element with white-space:nowrap ? Are there any advantages/disadvantages to either if the only thing I am looking to do is keep words from wrapping? 回答1: There are cases where nonbreaking space cannot help: word contains hyphen (e.g. web-developer ); hyphens: auto is used for element containing text to make hyphenation automatically. In these cases,

How to avoid text wrapping in a td with text and a right-floated label

僤鯓⒐⒋嵵緔 提交于 2019-12-03 07:39:09
http://jsfiddle.net/a2kvU/ <table class="table table-bordered table-condensed"> <tbody> <tr><td class="nowrap">abc def ghi jkl<span class="label label-info pull-right">123</span></td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td></tr> <tr><td class="nowrap">abc def ghi<span class="label label-info pull-right">456</span></td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td></tr> <tr><td class="nowrap">abc def<span class="label label-info pull-right">789</span></td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td><td>XYZ</td></tr> <tr>

几个关于换行的属性

隐身守侯 提交于 2019-12-02 16:15:46
参考 http://www.tuicool.com/articles/BZVJbq http://www.w3school.com.cn/cssref/pr_text_white-space.asp http://www.w3school.com.cn/cssref/pr_word-wrap.asp http://www.cnblogs.com/2050/archive/2012/08/10/2632256.html text-overflow text-overflow 属性规定当文本溢出包含元素时发生的事情。 取值: clip(默认值):修建文本 ellipsis:显示省略符号来代表被修剪的文本。 string :使用给定的字符串来代表被修剪的文本 想要实现溢出时产生省略号的效果。还必须定义: 强制文本在一行内显示(white-space:nowrap)及溢出内容为隐藏(overflow:hidden)。 white-space : nowrap; overflow : hidden; text-overflow : ellipsis; white-space white-space 属性设置如何处理元素内的空白 取值: normal(默认):空白会被浏览器忽略 (多个连续的空格被合并成一个,回车被忽略,如果句子太长,会在空白处换行) nowrap:文本不会换行

从零开始学习前端开发 — 12、CSS3弹性布局

蓝咒 提交于 2019-12-02 11:21:53
一、分栏布局 1.设置栏数 column-count:数值; 2.设置每栏的宽度 column-width:数值 单位; 注:当设置了column-width,column-count会失效,二者设置其一即可 3.设置栏间距 column-gap:数值 单位; 4.设置栏间隔线 column-rule:5px solid|dashed|dotted black; 5.设置是否跨栏显示 column-span:all(跨栏)|none(不跨栏); 注:a)给需要跨栏显示的元素设置该属性 b) 该属性只有chrome浏览器支持 二、弹性布局 说明: (1) 当给元素设置了display:flex;后,该元素就成为了弹性盒 (2) 当父元素设置了display:flex;后,子元素的float,clear,vertical-align将会失效 (3) 我们将设置display:flex;属性的父元素称为flex容器,里面所有的子元素称为容器成员或flex项目 (4) 当设置了display:flex;后会随之产生两根轴线:主轴和交叉轴 Flex容器属性 1.设置主轴方向 语法: flex-direction: row|row-reverse|column|column-reverse; row 默认值,主轴在水平方向,起点在左端 row-reverse 主轴在水平方向,起点在右端

Why do “inline-block” elements in a “nowrap” div overflow?

空扰寡人 提交于 2019-12-01 15:12:58
The following code causes #headline to overflow #wrapper and I do not understand why this is happening. HTML: <div id="wrapper"> <div id="logo"> <img src="/test.png"> </div> <div id="headline"> <h1>This headline overflows its wrapping div. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #</h1> </div> </div> CSS: #wrapper { background: #fea; white-space: nowrap; width: 50%; } #logo { display: inline-block; vertical-align: middle; } #logo img { width: 6em; } #headline { display: inline-block

Why do “inline-block” elements in a “nowrap” div overflow?

时光怂恿深爱的人放手 提交于 2019-12-01 14:05:18
问题 The following code causes #headline to overflow #wrapper and I do not understand why this is happening. HTML: <div id="wrapper"> <div id="logo"> <img src="/test.png"> </div> <div id="headline"> <h1>This headline overflows its wrapping div. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #</h1> </div> </div> CSS: #wrapper { background: #fea; white-space: nowrap; width: 50%; } #logo {

css white-space:nowrap horizontal scroll bug

牧云@^-^@ 提交于 2019-11-30 20:44:20
I have the following markup <style type="text/css"> #outer { min-height: 100%; height: auto !important; height: 100%; width:100%; white-space:nowrap; } #inner { background-color:#CCCCCC; margin:0px 4px 0px 4px; padding:5px 5px 0px 5px; border:1px solid #9A9A9A; border-width:1px 1px 0px 1px; } </style> <div id="outer"> <div id="inner"> TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST </div> </div> When the browser is wide enough, it looks like this When the browse is resized narrow, it looks like this I want the gray background of the narrow

Disable Word Wrap in an Android Multi-Line TextView

三世轮回 提交于 2019-11-30 06:21:01
I am working on a Month View with an advanced swipe (requires current, next and previous to be loaded to allow each view to stick to your finger) which means I have many views which causes things to be a little bit slow. | | #<-- screen bounderies ' previous ' current ' next ' #<-- three months loaded ' previous ' current ' next ' #<-- three months when the user drags their finger Because of this I want to represent multiple events in a single TextView. When the user taps one of the days on the Month View (small screen), it will open the day view for that day. On each day in the month view