I have a page with its own css controlling the layout and look. I'd like to add an iframe, or something similar, which allows me to plug another page into this one. The iframe page is coming from a server, and is used by many users, so I can't customize the iframe page to use the same css file on my server.
Is there a way to make an iframe use the css of the parent document - the page it is appearing inside?
To give you an idea as to what I'm talking about... I have a server feed, which sends me thumbnail photos, which I'd like to have appear on my page. I'd like to control how the thumbnails look, with css on the parent page. This is kind of like a flickr badge, except via an iframe. I think flickr just puts a table in your page and shoves css above it, within the body of the page (which is not exactly how it should be done, as I understand it).
Thanks,
SchomerAs far as I can tell, no. I had a situation similar to what you're talking about, but couldn't get things to work. CSS files work only on the calling document, or the document that imports the CSS file.
If a parent frame's CSS could affect a child frame's CSS, you could get into issues of someone else's CSS overriding the styles you wrote. That might even lead to legal issues of copyright or intellectual property, so CSS is limited to the document that imports the CSS file.
Although styling a child frame's document seems like a good idea, it opens the door to abuses of the technology.I can't imagine a legal issue pertaining to styling content, but regardless, I appreciate the feedback about the iframe content not being open to CSS from a parent document.
I'm guessing, if I had a CSS doc for the iframe that it would need to be located on the server the iframe page is coming from. If I could put a relative link in the iframe, to a CSS doc that is located relative to the parent, that would be nice. But I don't think that works.
I guess I'll have to give the user the ability to enter a URL to their own CSS for use in the iframe, then include that reference in the iframe doc when it is generated dynamically.
I wish I could do without the iframe. I have a grid of thumbnails with a next and previous link that goes to the next page of thumbnails. As far as I can tell, I can't seem to get it working without it being a separate page, via an iframe. I can make a static thumbnail grid without an iframe, but not one that can advance to another page.
Oh well. I'll keep searching for an option. I'm trying to create something like a Flickr Badge, but with previous/next links...
Thanks again for the feedback!
SchomerI can't imagine a legal issue pertaining to styling content,
There could be if you load someone else's site in a frame and use your CSS to hide some content or use incorrect CSS to mung up the display of the site.
I'm guessing, if I had a CSS doc for the iframe that it would need to be located on the server the iframe page is coming from. If I could put a relative link in the iframe, to a CSS doc that is located relative to the parent, that would be nice. But I don't think that works.
Not necessarily. The HTML document that's loaded in the iframe just needs to import the same CSS file as the parent frame's HTML document. In which case you could use an absolute link to the CSS file from the iframe HTML document. A frame must contain a whole HTML document. But if you can't control the iframe document there's nothing you can do.
I wish I could do without the iframe. I have a grid of thumbnails with a next and previous link that goes to the next page of thumbnails. As far as I can tell, I can't seem to get it working without it being a separate page, via an iframe. I can make a static thumbnail grid without an iframe, but not one that can advance to another page.
I guess I'm still not clear as to what you want. As for the provider of the thumbnails, I take it it's images and HTML they provide. Do they have some sort of XML feed you can use? Do you have access to a server side programming language like PHP? Otherwise you're pretty much stuck with how things are styled now.
By the way, it might be considered illegal to frame someone else's page in a way that makes people think it's your content, unless you own the content.i run a photo blog site - <!-- w --><a class="postlink" href="http://www.splashblog.com">www.splashblog.com</a><!-- w -->. i'm creating a feature where people can put a line of code in their own webpage and it will display a thumbnail grid on it - with thumbnails that are from the splashblog server. what i would like for them to be able to do is customize the look of the thumbnails/table so it matches their site - if they so choose. before it was an iframe, it was just a table put into the page, which was fine for css in that same page. but i want to offer a next/previous page link with it, and i can't figure out how to do that without an iframe.
here is an example of how it is working now...
---url removed (stale)---
this is a static page, with an iframe in it. the frame loads a page from the server to display the thumbnails. this is the part i'd like to adjust with css from the user's side - where the static page is located.
i can't use an absolute path to a css file because the user can put this script in any page they want.
i thought about letting the user enter a path to their own css file and including that in the script. that might work. but, i don't like how it is an extra step.
here's the setup page, if you want to see how the user creates the script for their own page...
---url removed (stale)---
it's changing, so it might be broken when you visit... try entering "schomer" for the blogURL to see how it works. it's not working that great in safari right now, by the way. try a windows browser if you test it out.
also, since i have an open ear, feel free to critique my approach! i could use some feedback from someone.
schomerYou might have better luck with some sort of user registration system. Then you could:
1) Assign each person an ID number
2) The user can choose to enter their own URL to their own CSS file to format the iframe.
2) The iframe source would pass the ID number to a server side script, which then would fetch the user-specified CSS file. -- OR -- Have a web-based control panel that allows users to point and click their way to formatting things. Or have an option to do either or.
This way you're keeping the styling info with the iframe document, by either using a web form to generate the CSS embedded on the iframe doc, or by having the iframe doc use @import to import an external CSS file.I think offering a field where they can enter their own path to their css file is the way to go.
However, I may have found another solution, which does not require iframes. I can do some image swapping. Problem is, if the table is not full of thumbnails - such as when you reach the last page of thumbnails - then you see empty squares. Maybe I could put a placeholder image in there instead.
Anyway, I think I'm close to having this all working.
Thanks for checking my stuff out and offering suggestions!
Schomer
Is there a way to make an iframe use the css of the parent document - the page it is appearing inside?
To give you an idea as to what I'm talking about... I have a server feed, which sends me thumbnail photos, which I'd like to have appear on my page. I'd like to control how the thumbnails look, with css on the parent page. This is kind of like a flickr badge, except via an iframe. I think flickr just puts a table in your page and shoves css above it, within the body of the page (which is not exactly how it should be done, as I understand it).
Thanks,
SchomerAs far as I can tell, no. I had a situation similar to what you're talking about, but couldn't get things to work. CSS files work only on the calling document, or the document that imports the CSS file.
If a parent frame's CSS could affect a child frame's CSS, you could get into issues of someone else's CSS overriding the styles you wrote. That might even lead to legal issues of copyright or intellectual property, so CSS is limited to the document that imports the CSS file.
Although styling a child frame's document seems like a good idea, it opens the door to abuses of the technology.I can't imagine a legal issue pertaining to styling content, but regardless, I appreciate the feedback about the iframe content not being open to CSS from a parent document.
I'm guessing, if I had a CSS doc for the iframe that it would need to be located on the server the iframe page is coming from. If I could put a relative link in the iframe, to a CSS doc that is located relative to the parent, that would be nice. But I don't think that works.
I guess I'll have to give the user the ability to enter a URL to their own CSS for use in the iframe, then include that reference in the iframe doc when it is generated dynamically.
I wish I could do without the iframe. I have a grid of thumbnails with a next and previous link that goes to the next page of thumbnails. As far as I can tell, I can't seem to get it working without it being a separate page, via an iframe. I can make a static thumbnail grid without an iframe, but not one that can advance to another page.
Oh well. I'll keep searching for an option. I'm trying to create something like a Flickr Badge, but with previous/next links...
Thanks again for the feedback!
SchomerI can't imagine a legal issue pertaining to styling content,
There could be if you load someone else's site in a frame and use your CSS to hide some content or use incorrect CSS to mung up the display of the site.
I'm guessing, if I had a CSS doc for the iframe that it would need to be located on the server the iframe page is coming from. If I could put a relative link in the iframe, to a CSS doc that is located relative to the parent, that would be nice. But I don't think that works.
Not necessarily. The HTML document that's loaded in the iframe just needs to import the same CSS file as the parent frame's HTML document. In which case you could use an absolute link to the CSS file from the iframe HTML document. A frame must contain a whole HTML document. But if you can't control the iframe document there's nothing you can do.
I wish I could do without the iframe. I have a grid of thumbnails with a next and previous link that goes to the next page of thumbnails. As far as I can tell, I can't seem to get it working without it being a separate page, via an iframe. I can make a static thumbnail grid without an iframe, but not one that can advance to another page.
I guess I'm still not clear as to what you want. As for the provider of the thumbnails, I take it it's images and HTML they provide. Do they have some sort of XML feed you can use? Do you have access to a server side programming language like PHP? Otherwise you're pretty much stuck with how things are styled now.
By the way, it might be considered illegal to frame someone else's page in a way that makes people think it's your content, unless you own the content.i run a photo blog site - <!-- w --><a class="postlink" href="http://www.splashblog.com">www.splashblog.com</a><!-- w -->. i'm creating a feature where people can put a line of code in their own webpage and it will display a thumbnail grid on it - with thumbnails that are from the splashblog server. what i would like for them to be able to do is customize the look of the thumbnails/table so it matches their site - if they so choose. before it was an iframe, it was just a table put into the page, which was fine for css in that same page. but i want to offer a next/previous page link with it, and i can't figure out how to do that without an iframe.
here is an example of how it is working now...
---url removed (stale)---
this is a static page, with an iframe in it. the frame loads a page from the server to display the thumbnails. this is the part i'd like to adjust with css from the user's side - where the static page is located.
i can't use an absolute path to a css file because the user can put this script in any page they want.
i thought about letting the user enter a path to their own css file and including that in the script. that might work. but, i don't like how it is an extra step.
here's the setup page, if you want to see how the user creates the script for their own page...
---url removed (stale)---
it's changing, so it might be broken when you visit... try entering "schomer" for the blogURL to see how it works. it's not working that great in safari right now, by the way. try a windows browser if you test it out.
also, since i have an open ear, feel free to critique my approach! i could use some feedback from someone.
schomerYou might have better luck with some sort of user registration system. Then you could:
1) Assign each person an ID number
2) The user can choose to enter their own URL to their own CSS file to format the iframe.
2) The iframe source would pass the ID number to a server side script, which then would fetch the user-specified CSS file. -- OR -- Have a web-based control panel that allows users to point and click their way to formatting things. Or have an option to do either or.
This way you're keeping the styling info with the iframe document, by either using a web form to generate the CSS embedded on the iframe doc, or by having the iframe doc use @import to import an external CSS file.I think offering a field where they can enter their own path to their css file is the way to go.
However, I may have found another solution, which does not require iframes. I can do some image swapping. Problem is, if the table is not full of thumbnails - such as when you reach the last page of thumbnails - then you see empty squares. Maybe I could put a placeholder image in there instead.
Anyway, I think I'm close to having this all working.
Thanks for checking my stuff out and offering suggestions!
Schomer