有没有办法可以用我自己的 CSS 来覆盖网站的 CSS?

发布于 2024-10-27 02:28:50 字数 794 浏览 1 评论 0原文

我每天都会使用一个网站,该网站有一个非常棒的语言学习闪存卡系统。

然而,该网站的作者似乎对如何实现良好的可用性有一种非常奇怪的感觉。它们使字体大小变得如此之大,以至于每个屏幕只能显示几行文本,并且必须向下滚动才能访问按钮。不要让我开始了解从移动设备访问该网站的感觉。

我一直在与该网站的开发人员联系,我什至为他们编写了 CSS 和标头代码,以便尝试提供帮助。虽然他们是好人,但不幸的是,他们几个月来一直不愿意或无法做出改变。

所以,我要变得流氓......我希望能够强加我自己的该死的CSS。

我依稀记得这在 Firefox 插件中是可能的,但现在似乎找不到了。

无论如何,因为我也渴望在我的手机上使用它,所以这是理想的解决方案:

我希望能够在我的网络服务器上设置一个页面,中继到源网站,但覆盖CSS 并用我自己的 CSS 显示给我。

这可能吗?我知道一些 CSS 技巧来重写内联样式,但我不太清楚如何设置一个网页来转发另一个页面的内容。

我希望我的解释和目标是明确的。如果我没有正确传达其中的任何部分,我会尽力澄清更多。

感谢您的任何提示。

更新:这是我放置在 userContent.css 中的 CSS,以尝试控制字体大小。

@-moz-document domain(badsite.com) {
body {
font-size: 12px;
}
font {
 font-family: inherit !important;
font-size: inherit !important;
color: inherit !important;
}
}

Every day I use a web site which has a really great flash card system for language learning.

However, the authors of the site seem to have a really bizarre sense of what makes for good usability. They make font sizes so large that you only get a few lines of text per screen, and you have to scroll down to access buttons. And don't get me started on what it's like to access the site from a mobile device.

I've been in contact with the developers of the site, and I have even written CSS and header code for them in order to try and help. While they're nice people, unfortunately they have for months been unwilling or able to make changes.

So, I'm going rogue... I want to be able to impose my own damn CSS.

I vaguely remember this being a possibility in a Firefox addon, but can't seem to find it now.

In any case, because I aspire to use this on my mobile phone as well, here's the ideal solution:

I'd like to be able to set up a page on my web server that relays to the source web site, but over writes the CSS and displays it to me with my own CSS.

Is this possible? I know some CSS tricks to over write inline styles, but I'm much less clear on how I can set up a web page to relay the content of another page.

I hope my explanation and goals are clear. I will try to clarify more if I haven't conveyed any part of this properly.

Thank you for any tips.

Update: Here is the CSS I've placed in my userContent.css to try and get font size under control.

@-moz-document domain(badsite.com) {
body {
font-size: 12px;
}
font {
 font-family: inherit !important;
font-size: inherit !important;
color: inherit !important;
}
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浅紫色的梦幻 2024-11-03 02:28:50

您可以在 Firefox 中编辑 userContent.css。使用 @-moz-document 来仅定位该网站。

@-moz-document domain(bad-ui-site.com) {
   body {
      font-size: 80%;
   }
}

我希望能够在我的网络服务器上设置一个页面,中继到源网站,但重写 CSS 并使用我自己的 CSS 将其显示给我

我建议您不要这么做。这很困难,而且可能违反了他们的条款。

You can edit userContent.css in Firefox. Use the @-moz-document to target that site only.

@-moz-document domain(bad-ui-site.com) {
   body {
      font-size: 80%;
   }
}

I'd like to be able to set up a page on my web server that relays to the source web site, but over writes the CSS and displays it to me with my own CSS

I'd recommend you don't. It is difficult, and probably violates their terms.

夜血缘 2024-11-03 02:28:50

我相信您所指的 FireFox 插件是 FireBug

至于您遇到的问题,我认为 Internet Explorer 让您为网页定义了自己的默认样式吗?

I believe the FireFox Addon you are referring to is FireBug

As for the problem you're having, I thought that Internet Explorer let you define your own default styles for Web Pages?

权谋诡计 2024-11-03 02:28:50

根据站点结构及其安全性,可以使用您自己的站点作为其代理。通过这种方式,您将有权更改任何客户端内容,例如 css、js 和 html。
这种情况不太可能发生,因为这意味着需要付出很大的努力才能将整个站点“重定向”到另一个站点;在许多情况下,如果站点不安全,它肯定具有您想要在代理中使用的服务器端功能,并且您无法使用此方法“复制”该功能。

depending on the site structure and it's security, it may be possible to use your own site as a proxy for it. In this manner, you would have the power to change any client-side content such as css,js and html.
This is very unlikely to happen, because it would imply a great effort to "redirect" a whole site to another one; in many cases, if the site is not secured, it surely has a server-side functionality that you want to use in your proxy and which you can't "copy" with this method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文