【发布时间】:2011-07-12 10:36:13
【问题描述】:
问题很简单,
下图是一个输入文本框。我已经设置了输入框值的值。加载页面时,它以多行显示。这只发生在 chrome 浏览器上。任何帮助
HTML:<input type="text" name="q" id="search_q" value="why is this happening in the input box">
这是输入框的css
input[type="text"], input[type="password"], select {
border: 1px solid #D1D3D4;
padding: 3px 5px;
border-radius: 4px;
background: white;
background: -moz-linear-gradient(top, white 0%, white 0%, #F2F2F2 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,white), color-stop(0%,white), color-stop(100%,#F2F2F2));
background: -webkit-linear-gradient(top, white 0%,white 0%,#F2F2F2 100%);
background: -o-linear-gradient(top, white 0%,white 0%,#F2F2F2 100%);
background: -ms-linear-gradient(top, white 0%,white 0%,#F2F2F2 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='white', endColorstr='#F2F2F2',GradientType=0 );
background: linear-gradient(top, white 0%,white 0%,#F2F2F2 100%);
}
map.generic.css:155
input, textarea {
margin: 0;
padding: 0;
font-family: Helvetica, Verdana, Arial;
color: #333;
font-size: 16px;
}
map.generic.css:148
input, a, div, textarea, img {
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}
map.generic.css:142
input, a, div, textarea, img, li {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
字体缩小后的另一张图片:
【问题讨论】:
-
当你选中那个框并自己写一些比宽度长的东西时,它会溢出到另一行吗?
-
是否还有样式正在应用这个jsFiddle 在 Chrome 中看起来不错。你觉得它怎么样?
-
@ancide:当我写更长的东西时,第一个字母进入下一行,继续它进入同一行。
-
已解决:已从 css 中删除:
div{word-break:break-word}