CSS - 不同的样式取决于不同的域

时间:2014-09-17 06:37:40

标签: css internet-explorer google-chrome stylesheet

我将根据域名更改网站的样式。

火狐-示例:

@-moz-document url-prefix("http//www.example.com") {
    body {
        background-color: rgb(176,230,230);     
    }         
}

是否有类似的内容,适用于Internet Explorer和Chrome?

此致

1 个答案:

答案 0 :(得分:0)

您可以尝试基于网址的CSS文件。

如果您使用的是RoR,那么这样的话会起作用。我相信其他框架也会有类似的东西。

- if (request.host == "http//www.example.com")
  = stylesheet_link_tag    "example", media: "all"
- else
  = stylesheet_link_tag    "application", media: "all"