【问题标题】:Make a form Input styled as text - To wrap down将表单输入样式设置为文本 - 结束
【发布时间】:2016-06-05 14:10:16
【问题描述】:

我有一个样式为文本的表单按钮输入, 我希望该文本根据它被困在的 DIV 的宽度进行换行。 但是没有

See Fiddle Here

CSS:

.content {
width:125px;height:180px;float:left;color:black;background:white
}
.text{overflow:visible;margin:0;padding:0;border:0;color:blue;background:0 0;font:inherit;text-decoration:none;cursor:pointer;-moz-user-select:text;line-height:normal}
.text:focus,.text:hover{color:#333;text-decoration:underline}
.text::-moz-focus-inner{padding:0;border:0}

HTML:

  <div class="content">
    <form action="a.php" method="POST" target="_blank">
    <input type="submit" class="text" value="Some Very Long Text Here Doens't Wrap">
    </form> 
  </div>

【问题讨论】:

标签: html css word-wrap


【解决方案1】:

word-break: break-word;white-space: normal; 添加到您的输入标签。像这样

.text {
  word-break: break-word;
  white-space: normal;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  color: blue;
  background: 0 0;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  -moz-user-select: text;
  line-height: normal
}

在这里工作 JSFiddle https://jsfiddle.net/bw74vxwd/6/

【讨论】:

  • 谢谢,它可以工作,但有一个缺陷,我现在遇到了同样的问题 in this unsolved question
  • 该线程中有一个具有类似问题的小提琴:here 制作另一个可以清楚显示此问题的小提琴将很复杂,因为我需要删除大量代码。
  • 好的。您能详细解释一下您现在面临的问题吗?
猜你喜欢
  • 1970-01-01
  • 2014-09-18
  • 2011-12-18
  • 1970-01-01
  • 1970-01-01
  • 2011-01-20
  • 1970-01-01
  • 1970-01-01
  • 2021-11-30
相关资源
最近更新 更多