GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   CSS question (https://gfy.com/showthread.php?t=1051909)

NaughtyVisions 12-30-2011 11:33 PM

CSS question
 
Ok, so I putting a page in an iframe from a completely different site. The content of this page is utilized on a bunch of different sites, so keeping it in one place so changes can be made once to apply to all domains is essential.

I'm trying to get the content of the page within the iframe to match the site I'm putting it on as far as text/link colors, etc.

So, I'm thinking I have to put the iframe in a div id, and in my css file, actually associate the page being pulled, so that way customization I apply in my css will actually affect the contents in the iframe.

So here is what I'm thinking for the actual page on the domain:

Code:

<iframe scrolling="auto" allowtransparency="true" frameborder="0" height="225px" width="720px">
<div id="whatever">
</div>
 </iframe>

My problem is how to actually pull the "pathtomycode.html" page in my css file.

I know this is not right, but something like:

Code:


div#whatever {http://pathtomycode}

Am I like way fucking off here? What's the easiest way to do this?

I'm finally trying to get off of just basic html coding and on to stuff that was only outdated 5 years ago instead of 10. :winkwink:

barcodes 12-30-2011 11:48 PM

just to verify, you have a page on your server that you would like to duplicate on other sites but change the colors, sizes etc via css right? or is it a page from another website?

Edit: Can you modify the page in the iframe is what am trying to ask. sorry, a bit sleepy

barcodes 12-31-2011 12:04 AM

Here is a very simple example. I would out the css in my main stylesheet but put it on the main page for simplicity.

Lets say you have mainpage.php and textpage.php.

Your mainpage.php could be something like this:
Code:

<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test page</title>
<style type="text/css">
#frameStyle .titles {
        font-weight:bold:
        color: #F00;
}
#frameStyle .copy{
        color: #cc0;
}
</style>
</head>

<body>

<?php include 'test.php'?>

</body>
</html>

And the textpage.php could be something like this:
Code:

<div id="frameStyle">
<div class="titles">title for your page</div>
<div class="copy">copy for the page</div>
</div>

If you dont want to make classes for everything you can do it by the format tags, #framestyle h1 or #framestyle p for example. The example is done on php but you could do it with coldfusion
Code:

<cfinclude template="textpage.cfm">
asp
Code:

<!--#include file="textpage.inc"-->
etc...

This is assuming you can add the proper ids and classes to the content page you want to include in your various sites.
Best of luck

raymor 12-31-2011 12:06 AM

You're going to run into same origin issues trying to style the content of a page loaded from another domain. It may appear to work in some versions of some browsers, but the trend is toward stricter controls on cross domain access.

You can use jquery to pull it into your domain:

<html> <header> <script src="/js/jquery.js" type="text/javascript"> </header> <body> <div id='include-from-outside'></div> <script type='text/ javascript'> $('#include-from-outside').load('http:// example.com/included.html'); </script> </body> </html>

In a noscript stanza you can put the unstyled iframe or iframe a copy pulled to your server periodically.

NaughtyVisions 12-31-2011 12:07 AM

In a nutshell, it's a "warning blurb" that the person I'm doing some stuff for has on all of her sites. The warning itself is an html page that is hosted on one of her domains. She has it in a iframe on a bunch of her sites, but they all have the default color scheme from the site that the warning.html page is hosted on. I'm putting it on a site I re-vamped, and want the text/link colors in that file to match the site I re-vamped, not the one it's hosted on.

I made the iframe transparant, but short of copying the file onto the domain I re-vamped and hosting it there, I was told by someone else to code it into the CSS file, which I'm at a loss for. I'd just put it on the domain I revamped and pull it from there, but should the master file get changed elsewhere, I won't get those changes on the new site.


Edit: Just saw the replies...reading now...

raymor 12-31-2011 12:10 AM

Quote:

Originally Posted by NaughtyVisions (Post 18661274)
The warning itself is an html page that is hosted on one of her domains. She has it in a iframe on a bunch of her sites, but they all have the default color scheme from the site that the warning.html page is hosted on. I'm putting it on a site I re-vamped, and want the text/link colors in that file to match the site I re-vamped, not the one it's hosted on.

In that case what you need are symlinks, so foo.com/httpdocs/iframe.html is the same file as bar.com/httpdocs/iframe.html

iframe.html can reference style.css and it'll use style.css from the current site.

barcodes 12-31-2011 12:11 AM

Ah, sorry. Without the details I may have misunderstood what you were going for.
I am sure raymor knows more about the warning page stuf than I would =D

good luck with it!

raymor 12-31-2011 12:17 AM

Quote:

Originally Posted by barcodes (Post 18661279)
Ah, sorry. Without the details I may have misunderstood what you were going for. I am sure raymor knows more about the warning page stuf than I would =D

good luck with it!

I think your PHP method is a good way to go. Assuming of course you're not using safe mode, which you should not so long as safe mode stupidly implies suexec. (That's so dumb that "safe" mode requires "stupidly dangerous mode".)

Also assuming the pages use other PHP - at least until PHP 6.0 comes out I tend away from needlessly executing all documents as programs.

The Truth Hurts 12-31-2011 12:34 AM

you can't do what you're asking, the way you're asking.
even if you trick it into working with js/jquery it would raise security warnings in certain browsers because if cross frame scripting.

just make your own duplicate of the iframe on the same domain or take the content of the iframe and stick it inline.
then style it however the hell you want.

Mr Pheer 12-31-2011 09:42 PM

Try doing it as a php include.

misterhhs 01-01-2012 12:17 AM

Read the file in php with fopen, filegetcontents...and print it out on your page. But I don't know if crossdomain is allowed.


All times are GMT -7. The time now is 08:02 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123