【问题标题】:How to fix submit button with css parameters for internet explorer?如何使用 Internet Explorer 的 css 参数修复提交按钮?
【发布时间】:2017-06-24 21:06:19
【问题描述】:

我的网站在 chrome nad firefox 上运行良好,但显然在 Internet Explorer 11 上它没有正确显示提交按钮。

有人可以检查一下是什么问题

这是按钮的 style.css 代码:

#searchsubmit { 
 font-family: Frutiger, Lato;
 background: url('images/search.png');
 cursor: pointer;
 width: 30px;
 height: 30px;
 border: 0px;
 float:right; 
 margin-top:5px;
}

.searchform input, .searchform input#s, placeholder { 
 font-family: Frutiger, Lato;
 background: #4D6B87;
 height: 30px;
 border: 0px;
 color: #EAEAEA;
 font-size: 14px;
 padding-left: 5px; 
}

所有 style.css 都可以在这里找到:www.virmodrosti.com/wp-content/themes/virmodrosti/style.css

【问题讨论】:

    标签: css


    【解决方案1】:

    第一个解决方案:

    我找到了一种方法,但您必须使用 Internet Explorer 的条件注释,这将解决您的问题,请这样做:

    <!--[if IE]>
    <style>
        #searchsubmit {
             position:absolute;
             right:20px;
        }
    </style>
    <![endif]-->
    

    第二种解决方案:

    我不确定这个,因为我不再使用 Internet Explorer,所以我无法测试它,但也许你只需添加:

    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    

    它只能在 Internet Explorer 11 上模拟为边缘,但您必须尝试。

    【讨论】:

      【解决方案2】:

      试试这个代码:

      .searchform#searchform input, .searchform#searchform button {
          display: inline-block;
          float: none;
          vertical-align: middle;
          margin: 0;
      }
      .searchform#searchform input {
          width: calc( 100% - 40px );
          margin-right: -2px;
      }
      .searchform#searchform button {
          width: 30px;
          margin-left: -2px;
      }
      

      【讨论】:

      • 这是因为这个条目而发生的吗 * { padding: 0;边距:0; },也许 IE 不能正确识别?
      猜你喜欢
      • 2010-09-25
      • 2012-03-26
      • 2011-11-26
      • 2011-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-11
      • 2012-09-08
      相关资源
      最近更新 更多