Displaying an external page using your own stylesheet

Soldato
Joined
16 May 2005
Posts
6,509
Location
Cold waters
Hi - Does anyone know if it is possible (and how) to display a page from an external server using a stylesheet of your choosing rather than the one actually used?

e.g.


I've not had much luck searching because there are many ways to word the question. Can this be done using javascript?
 
Last edited:
Isn't that a personal plugin? I mean making every visitor of banana.com see it that way.

Looking in to this still - would the best way be to put the external page in an iframe - then use javascript to do a search and replace of href="http://monkey.com/style.css" with href="http://banana.com/style.css" within the iframe's content at runtime?

Do browsers automatically 'refresh' in-memory 'pages' when you modify their source code at runtime? Bare in mind I know very little about web development :)
 
Last edited:
You could use selectors to over-ride the CSS on the external page, however i'm not how you'd go about including an external page with an iframe or the like, and even then a lot of current sites will automatically break out of frames.

Assuming you get it to load inside the iframe or something else you could include a stylesheet along with it that has the necessary CSS selectors to over-ride the exteral page's CSS.
 
Use PHP to fetch a data feed (x(ht)ml) and tack on the style sheet of choice.

However, can you please explain what's going on so that I can be sure if I should be frowning?
 
as above, Use a server side http request to pull in the content and reskin with your own css. you can even use regex etc to remove <head> content. however, and this is a big however, you should not be using this method to steal or use another sites content without permission.

if you have permission there are better ways of getting the data to your site.
 
Thanks guys. I used the domains as an example - it's not for use the the public internet, so I'm not looking to nab someone's bandwidth / content!
 
Back
Top Bottom