Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Apply CSS across domains?

I was wondering if it is possible to link to a CSS file across domains without security/cross browser issues.

Here is the setup: Manage one primary site on Domain A with secondary content on Domain B. Both sites use same layout/design. I have direct control over Domain A, but changes to Domain B require a third party to implement.

I would like to have immediate control over the stylesheet and wass thinking about having the CSS file on Domain B be a hard link to the file on Domain A.

So instead of the LINK tag on Domamin B being a relative link to the finle on Domain B, its a URI to the file on Domamin A.

Any issues I should be concerned with?

Update:

Good answers so far - thanks!

Ownership of styles is mine, and other service is contracted out so ownership issue not an issue. Just want to eliminate the need of the middle person.

Big factor is to have changes take place on both sites simultaneously without having to wait.

3 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    I do it on mine...link rel="stylesheet" href="..., with the url being absolute instead of relative

    I've bumped into myself through my own stooopidity a few times, though, by updating the css for one website without remembering the impact it'll have on the other!

    And remember, it'll slow down the load time, because the server has to go out and contact the css web server on the other website to fetch the css file at least once.

  • 1 decade ago

    Just make sure that you can access the file from Domain B (shouldn't be a problem if you can access Domain A CSS URL from outside the hosting company network).

    And no, I don't think there are any security consideration.

    If you're using someone else's CSS, that's another problem.

  • Anonymous
    1 decade ago

    No issues I can think of. All it's doing is loading the CSS file into the other site. Have done this myself and it worked fine n dandy. Just be careful if you're using free hosting or whatever sometimes they have hotlink protection and might see it as your other site hotlinking your pages. Probably not though.. so link away!

    Source(s): Personal experience.
Still have questions? Get your answers by asking now.