【问题标题】:Textarea's style won't work with Mobile jqueryTextarea 的样式不适用于 Mobile jquery
【发布时间】:2015-09-04 20:27:10
【问题描述】:

按照我的question,我有一些CSS,但是因为textarea 位于扮演页面角色的div 内部,所以它不会起作用。我能以某种方式做到这一点吗?唯一重要的是让边框变得漂亮,并使文本区域相对较小(现在它将占据屏幕的所有宽度),就像我的fiddle 一样。

textarea {
    display: block;
    box-sizing: padding-box;
    overflow: hidden;
    padding: 10px;
    width: 250px;
    font-size: 14px;
    margin: 50px auto;
    border-radius: 8px;
    border: 6px solid #556677;
    width: 30%;
}

【问题讨论】:

    标签: jquery css jquery-mobile textarea effects


    【解决方案1】:

    请记住,在使用 jQuery Mobile 时,!important 是您最好的朋友。没有它,您将无法覆盖激进的 jQuery Mobile CSS。

    工作示例:http://jsfiddle.net/3qaet2d2/

    textarea{  
      display:block !important;
      box-sizing: padding-box !important;
      overflow:hidden !important;
    
      padding:10px !important;
      width:250px !important;
      font-size:14px !important;
      margin:50px auto !important;
      border-radius:8px !important;
      border:6px solid #556677 !important;
    }
    

    【讨论】:

    • 什么是重要的?这听起来是一个普遍的问题,但我要求的是那个东西(我们怎么称呼它?一个属性?)。
    • !important 关键字很重要。 !important 规则是一种让你的 CSS 级联的方法,但也有你认为最重要的规则始终被应用。无论该规则出现在 CSS 文档中的什么位置,都将始终应用具有 !important 属性的规则。
    猜你喜欢
    • 2013-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-07
    相关资源
    最近更新 更多