css - 试图模拟文本框

标签 css

我尝试使用 CSS 模拟文本框

HTML:

<div id="event_box" class="margin-bottom-10"></div>

<div class="col-md-9 col-sm-12">
<div id='calendar' style="width:100%"></div>

CSS:

#event_box {
    -moz-appearance: textfield-multiline;
    -webkit-appearance: textarea;
    border: 1px solid gray;
    font: medium -moz-fixed;
    font: -webkit-small-control;
    height: auto;
    padding: 2px;
    resize: none;
    width: 318px;
    margin-top: 20px;
}

event_box 是我的文本框,问题是当它得到结果时,它们会像这样超出边界: enter image description here

我需要做什么才能将收到的数据保存到文本框中?问候

Fiddle

最佳答案

将这一行添加到您的 CSS 中:

word-wrap:break-word;

我希望它有用。

关于css - 试图模拟文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44636400/

相关文章:

javascript - 移动网站 - 右侧空白区域

html - 视差效果在 Firefox 中不起作用

javascript - Bootstrap 卡不能一直 flex 到全宽

css - Angular CLI : Inject css on Sass compile without full reload?

html - 定位固定怎么固定

css - Foundation 6.4.1 - 如何修复下拉菜单的宽度?

html - 在表格单元格上强制断字

css - Overflow X 不适用于 CSS Transform 属性

php - Wordpress 不允许我在 div 中隐藏自定义字段?

html - 元素在不同浏览器中显示不同