CSS不能在Safari中工作 - 在Chrome,Firefox中可以使用 [英] CSS not working in Safari - OK in Chrome, Firefox

查看:98
本文介绍了CSS不能在Safari中工作 - 在Chrome,Firefox中可以使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站是 http://proustscookies.blogspot.com/ 。我正在使用CSS设计附加到搜索表单的按钮样式。



以下是CSS:

  input.gsc-search-按钮{
margin-left:10px;
height:24px;
width:60px;
border-style:none;
背景颜色:#666666;
font-family:Helvetica,Arial,sans-serif;
font-size:13px;
颜色:#FFFFFF;
}

margin-left命令在Firefox和Chrome中运行良好,但不是所有其他的CSS规则(以上和整个网站,数据未显示)在所有三种浏览器中都能正常工作(而且最后一次我也在IE中进行了检查) 。



使用Chrome扩展程序Stylebot找到了对象名称(input.gsc-search-button)。不幸的是,我无法在任何地方找到底层html(这是一个博主推荐的小部件,Google可以隐藏代码吗?我不知道。)



如果任何人都可以帮助我找出为什么边缘不在Safari中显示,或者如何找到搜索框的HTML,我将非常感激。 解决方案

Google会覆盖它。
如果你这样做:

  margin-left:10px!important; 

您可以覆盖它。



或你可以使你的选择器更加具体化(并因此给予它优先权),通过做一些类似的事情:

  td.gsc-search-button input .gsc-search-button {
margin-left:10px;
}

提示:您可以右键单击某个元素(在Firefox或Chrome中)和点击检查元素查看与该元素关联的CSS。


My website is http://proustscookies.blogspot.com/. I'm working on styling the buttons attached to the Search form using CSS.

Here is the CSS:

input.gsc-search-button {
margin-left: 10px;
height: 24px;
width: 60px;
border-style: none;
background-color: #666666;
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
color: #FFFFFF;
}

The margin-left command is working great in Firefox and Chrome, but not at all in Safari.

All other CSS rules (above and throughout the site, data not shown) are working in all three browsers (and last time I checked also in IE).

I found the object name (input.gsc-search-button) using the Chrome Extension Stylebot. Unfortunately I can't find the underlying html anywhere (This is a blogger-sponsered widget. Could Google be hiding the code somewhere? I don't know.)

If anybody could help me figure out why the margin isn't showing in Safari, or how to find the html for the Search box, I would appreciate it very much.

解决方案

It's overridden by google. If you do:

margin-left: 10px!important;

You can override that.

Or you could make your selector more specific (and hence give it precedence) by doing something like

td.gsc-search-button input.gsc-search-button {
   margin-left: 10px;
}

Hint: you can right click on an element (in firefox or chrome) and click "inspect element" to see the css associated with that element.

这篇关于CSS不能在Safari中工作 - 在Chrome,Firefox中可以使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆