Neal <ne*****@spamrc n.com> wrote:
It's my understanding that CSS does not affect frameset documents. I
base that solely on not recalling any instance of frameset ever being
mentioned in the CSS specs, so I may be in error.
The CSS specifications do not discuss framesets*), but this does not
exclude them from the scope of applicability of CSS. And the sample style
sheet for HTML 4 in the CSS 2 specification sets some properties for
FRAMESET, FRAME, etc., too. (Nothing fancy, just things like
display: block, but still.)
*) In discussing positioning, CSS 2 spec mentions features that can be
used "to create frame-like presentations", but this does not imply that
framesets themselves could not be affected by CSS.
There's not much one can do with CSS to a frameset.*) One might try
settings widths and heights for the frames, but this is usually less
convenient than just doing so in markup - and could cause browser
confusion I'm afraid.
*) One needs to remember that a style sheet affects the document only,
not any document that it embeds, via the FRAME element or otherwise. So
you cannot e.g. set the font size effectively, except for the NOFRAMES
part, for the few advanced noframes-capable CSS-enabled browsers.
Setting borders is a special problem. Since frameset rendering has not
been described in CSS terms, even in the somewhat obscure sample style
sheet for HTML 4, we don't really know how to affect it in CSS, except by
trial and error, and knowing that whatever works on one browser may fail
on another. For IE at least, it is possible to set the color and width of
borders as follows:
- use nonstandard HTML attributes to remove all frame borders
(<frameset ... frameborder="0" border="0" framespacing="0 ">)
- use standard CSS to suggest the borders you like for the frame
elements.
See
http://www.cs.tut.fi/~jkorpela/tekoik/keh.html for a demo.
It uses three frames and sets some colored borders:
frame { border: solid #090 0; }
#f1 { border-right-width: medium; }
#f2 { border-bottom-width: medium; }
Note: f1 and f2 have been defined as <frame id="f1" ...>. The id
attribute values need not be descriptive, unlike the name attribute
values for frame elements - remember that name values will be spoken to
people using speech browsers, displayed to people using Lynx, etc.
So they should be short but informative of content, and naturally in the
language of the document. This is why it is convenient to use id
attributes for referring to the frames in CSS, especially since in CSS
selectors, it's best to use Ascii characters only.
I don't particularly like the idea of colored frames borders. It makes me
ask whether the scrollbars should be colored too, and then I'm on the way
to hel^H^H^Hcreati ng a user interface for myself and not for users.
Besides, that would be somewhat inconvenient, since apparently I would
need to put the (currently IE specific) scrollbar property settings into
body { ... } rules in a style sheet for each framed document, rather than
(as I first expected) into a frame { ... } rule in a style sheet for the
frameset document. And this would imply that I need to have separate
versions of the documents for framing, something that I normally avoid.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/