![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: May 2008
Location: Pennsylvania
Posts: 4,204
|
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> I know this is not right, but something like: Code:
div#whatever {http://pathtomycode} 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. ![]()
__________________
Online strip gaming with sexy gamer girls Best thing I ever signed up for: Quality Razors, Cheap Price |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Mar 2011
Location: Florida
Posts: 2,040
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Mar 2011
Location: Florida
Posts: 2,040
|
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> Code:
<div id="frameStyle"> <div class="titles">title for your page</div> <div class="copy">copy for the page</div> </div> Code:
<cfinclude template="textpage.cfm"> Code:
<!--#include file="textpage.inc"--> 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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: May 2008
Location: Pennsylvania
Posts: 4,204
|
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...
__________________
Online strip gaming with sexy gamer girls Best thing I ever signed up for: Quality Razors, Cheap Price |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Quote:
iframe.html can reference style.css and it'll use style.css from the current site.
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Mar 2011
Location: Florida
Posts: 2,040
|
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! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Quote:
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Zph7YXfjMhg
Industry Role:
Join Date: Nov 2002
Location: In Your Skull
Posts: 15,274
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Posts: 20,887
|
Try doing it as a php include.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Oct 2005
Posts: 165
|
Read the file in php with fopen, filegetcontents...and print it out on your page. But I don't know if crossdomain is allowed.
|
![]() |
![]() ![]() ![]() ![]() ![]() |