471,598 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,598 software developers and data experts.

Spacing problem in IFrame

Hi All,

I'm working on building a website that presents a lot of CSS
examples. A menu in the left column lets the user choose an example,
which then populates the center column (and, later, the right column).

The source for the examples will be stored in a bunch of sub-folders.

Right now, Example 1 populates the center column, but it has a
scroll bar because it doesn't utilize the height of the center column.
I should be able expand Example1.html with a reference something in
CssVisualDemo.html that specifies the height, but what?

Thanks in Advance,
Richard

Code: http://home.comcast.net/~CaptQueeg/CssVisualDemo.html

Sep 12 '07 #1
9 3146
Just a couple things more:
I should be able expand Example1.html with a reference something in
CssVisualDemo.html that specifies the height, but what?

Correction: "I should be able to reference something in
CssVisualDemo.CSS" (rather than .html.)

Also, here's the previous version, where text populated the center
column, rather than an IFrame: http://home.comcast.net/~CaptQueeg/C...lDemo-Old.html

Sep 12 '07 #2
I've got a better idea that, sadly, doesn't seem to work:

I tried setting the innerHTML of a DIV with both the styling and body
of an example that uses selectors. I made a simple test case at
http://home.comcast.net/~CaptQueeg/T...s-WithSel.html,
which validates.

The key line is:
<div STYLE="h2{color: red; font-size: 10pt;}"<h1>H1</h1<h2>H2</h2>
<h1>H1</h1></div>

The font size works, i.e. the H2 element, and only that element, has
a reduced font size.

But the color attribute is on honored, regardless whether it's in the
first or second position. Nor did background-color work, when I tried
that instead of color.

Is there some way to get this working, especially since it is valid?

Sep 12 '07 #3
RichardOnRails wrote:
The font size works, i.e. the H2 element, and only that element, has
a reduced font size.
I see the <h2at my default browser rendition of a normal <h2>, and not
at 10pt. BTW, points are for printing; use percentages or em units for
screen use.
http://k75s.home.att.net/fontsize.html
Is there some way to get this working, especially since it is valid?
No, it is not valid CSS. And dodgy HTML, too.

<http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fhome.comcast.net%2F~Cap tQueeg%2FTestInlineStyles-WithSel.html>

--
-bts
-Motorcycles defy gravity; cars just suck
Sep 12 '07 #5
On Sep 12, 8:09 pm, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:

Thanks for posting back, Beauregard.
Have you considered making the 'user-selectable pages' complete pages,
and using includes for everything else around that content?
No, because I never heard about it, but it sounds promising
Might be
easier than messing with iframes, which are not valid in a Strict
doctype.
That's great! I took the iFrames route because someone thought it'd
be easier for me.
<http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fhome.comcast...>
Sorry 'bout that. It's because my script is still a work-in-progress.

I took a quick look on Google for a tutorial/guide on 'user-selectable
pages' . I haven't found anything good yet, but I'll keep hunting.

Again, thanks for turning me on to this technique.

Best wishes,
Richard


Sep 13 '07 #6
RichardOnRails wrote:
"Beauregard T. Shagnasty" wrote:

Thanks for posting back, Beauregard.
>Have you considered making the 'user-selectable pages' complete
pages, and using includes for everything else around that content?

No, because I never heard about it, but it sounds promising
In simple example... "pagefilename.php"

<?php
include "head.inc";
include "banner.inc";
include "menu.inc";
/* Content for this page follows */
?>

<h1>This is a heading</h1>
<p>Content here...</p>

<?php
/* End content for this page */
include "footer.inc";
?>

--
-bts
-Motorcycles defy gravity; cars just suck
Sep 13 '07 #7
On Sep 13, 8:30 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
In simple example... "pagefilename.php"

<?php
[snip]
?>
Thanks for the example, but I don't know PHP and I don't really see
how I can generalize it to my situation.

The only write-up I've found on the Web that I might be able to apply
is "Style Sheet Switcher": http://tutorial.jcwcn.com/Web-Design...7-10/2092.html.
I'm just implementing an example based on that website so I can really
assess the applicability to my site.

I had hoped that W3C might have provided more details on user-
selectable pages. Unless I misunderstood its offerings, they didn't
seem that helpful to my goal.

If you know offhand of any site(s) that offer sample implementations
employing user-selectable pages,
I'd appreciate hearing about it/them.
--
Richard

P.S.You may want to ignore this paragraph: If I can't get "regular"
HTML/CSS code to work, then for each of my html/css examples, I'll
capture its browser image and display the image corresponding to the
user's selection in the center frame of main page. In addition, I'll
write a preprocessor to suck the style and body code from the examples
and stuff those chunks into string arrays for styles and bodies. When
a user chooses an html/css example, my site will display corresponding
style and body code in textarrays along side the image of the example
page. For now, that's my fall-back strategy. It's what you might
expect from an ex-Fortran, Cobol, PL/1, C, C++ programmer :-)
--
Richard

Sep 13 '07 #8
RichardOnRails wrote:
>
I had hoped that W3C might have provided more details on user-
selectable pages.
Um, aren't *all* web pages "user-selectable"?

I haven't really been following this thread, but it sound like SSI is
what you need. BTS gave you a php example, and here are some more ideas:
http://allmyfaqs.net/faq.pl?Include_one_file_in_another

--
Berg
Sep 13 '07 #9
On Sep 13, 5:37 pm, Bergamot <berga...@visi.comwrote:

Hi Bergamot,
I had hoped that W3C might have provided more details on user-
selectable pages.

Um, aren't *all* web pages "user-selectable"?
Yes, I didn't say that clearly. I was talking about the various kind
of selectors, like the half-dozen or so listed in
http://css.maxdesign.com.au/selectutorial/, e.g. Type, Class, ID,
Descendant. For my own edification, I want to illustrate the various
ways each of these techniques can be applied. Make sense?
I haven't really been following this thread, but it sound like SSI is
what you need.
I've done some SSI with Ruby on Rails. But I wanted to stay at the
level of CSS and Client-side JavaScript, maybe with AJAX ( which is
lighter machinery than ROR, AFAIK) if I have to use a webserver.

BTS gave you a php example, and here are some more ideas:http://
allmyfaqs.net/faq.pl?Include_one_file_in_another

That site looks right up my alley. Thank you very much for mentioning
it. I'll be studying it in the next couple of days. As I mentioned
to Beauregard, I'm concentrating on learning how to use debuggers for
JavaScript in the context of FireFox/FireBug and Aptana.

Best wishes,
Richard

Sep 19 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Rick DeBay | last post: by
5 posts views Thread by Andrew Poulos | last post: by
4 posts views Thread by fleemo17 | last post: by
12 posts views Thread by Sebastien B. | last post: by
10 posts views Thread by phil-news-nospam | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.