【问题标题】:Search Box/Transition won't work in Firefox搜索框/转换在 Firefox 中不起作用
【发布时间】:2013-06-26 13:46:56
【问题描述】:

我禁用了 IE 上的搜索框,因为 IE 一直将其置于导航的中心。 它在 Chrome 中工作,我不确定歌剧(我不确定我是否关心)但它在 Firefox 中不起作用。缓出时间在 Firefox 中有效,但没有其他真正有效。

我尝试了其他方法来解决此问题,但每次我尝试不同的方法时,搜索框的定位都会被抛出。

如果您在 Firefox 中查看它,它看起来很好 - 直到您单击它进行搜索。 http://kissoff.weebly.com/ 在 Chrome 中查看并点击搜索框,您可以看到搜索框应该做什么。

我确定定位已关闭,我不确定(我是 CSS 新手)。任何帮助表示赞赏。 #search {}

#search input[type="text"] {
background: url(search-white.png) no-repeat 10px 6px #fcfcfc;
border: 1px solid #d1d1d1;
position: fixed;
margin-left: 350px;
margin-right: 0px;
margin-top: 0px;
color: #bebebe;
width: 150px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7s ease 0s;
float: right;
}
#search input[type="text"]:focus {
width: 200px;
}

【问题讨论】:

  • position: fixedfloat 一起使用有点奇怪。
  • @user2522488 下面是我的答案。检查一下。尝试解释问题而不是生成视图。

标签: css firefox


【解决方案1】:

您忘记编辑左边距。 http://jsfiddle.net/xeemez/nZBNm/

#search{
background: url(search-white.png) no-repeat 10px 6px #fcfcfc;
border: 1px solid #d1d1d1;
position: fixed;
margin-left: 350px;
margin-right: 0px;
margin-top: 0px;
color: #bebebe;
width: 15px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7s ease 0s;
float: right;

}
#search:focus {
width: 200px;
margin-left: 200px;
}

http://jsfiddle.net/xeemez/nZBNm/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-11
    • 2014-06-26
    • 2013-11-27
    • 2013-06-26
    • 1970-01-01
    • 2013-01-21
    相关资源
    最近更新 更多