By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,724 Members | 1,655 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,724 IT Pros & Developers. It's quick & easy.

Frames, Framesets and CSS

P: n/a
x


Greetings everyone:

I am trying to get CSS to work with a framed web page, but I cannot.

Does anyone know the syntax required in a CSS specification
to specify attributes of the frames?

Ideally, I want to be able to change the border thickness, colour, etc.

Additionally, does anyone know of some comprehensive examples/tutorial
out there about how to use CSS?

Thanks in advance for your assistance.

-*- a puzzled and somewhat frustrated newcomer to CSS -*-
This is what I have for the html (named sample.html):

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvv
<!doctype html public
"-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd"
<html>
<head>
<link href = "sample.css"
rel = "stylesheet"
type = "text/css"

</head>
<frameset rows = "50%,*" cols = "50%,*">
<frame name = "ul">
<frame name = "ur">
<frame name = "ll">
<frame name = "lr">
</frameset>
</html>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^

and here is the style sheet (named sample.css):

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvv

FRAME
{
bordercolor : #ff0000
frameborder : yes
border : 50
}
FRAMESET
{
bordercolor : #00ff00
frameborder : yes
border : 25
}

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
Jul 20 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
x <news:40**************@dev.null>:
I am trying to get CSS to work with a framed web page, but I
cannot.

Does anyone know the syntax required in a CSS specification
to specify attributes of the frames?


http://www.w3.org/Style/CSS/
http://www.htmlhelp.com/reference/css/

--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
Jul 20 '05 #2

P: n/a
On Thu, 01 Apr 2004 22:26:12 GMT, x <x@dev.null> wrote:


Greetings everyone:

I am trying to get CSS to work with a framed web page, but I cannot.

Does anyone know the syntax required in a CSS specification
to specify attributes of the frames?
The WC3 knows. All the valid CSS properties are listed at
http://www.w3.org/TR/CSS2/propidx.html .

FRAME
{
bordercolor : #ff0000
frameborder : yes
border : 50
}
FRAMESET
{
bordercolor : #00ff00
frameborder : yes
border : 25
}

See, you're just making shit up. It doesn't work that way.

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. I welcome correction.
Jul 20 '05 #3

P: n/a
Neal <ne*****@spamrcn.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^Hcreating 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/
Jul 20 '05 #4

P: n/a
On Fri, 2 Apr 2004 06:12:51 +0000 (UTC), Jukka K. Korpela
<jk******@cs.tut.fi> wrote:
And the sample style
sheet for HTML 4 in the CSS 2 specification sets some properties for
FRAMESET, FRAME, etc., too.


I've heard mention of the sample CSS, but have not encountered it
documented. Where can I find this? Is it a local css file stored with the
browser, or available at WC3? Or am I totally off?
Jul 20 '05 #5

P: n/a
Neal wrote:
On Fri, 2 Apr 2004 06:12:51 +0000 (UTC), Jukka K. Korpela
<jk******@cs.tut.fi> wrote:
And the sample style
sheet for HTML 4 in the CSS 2 specification sets some properties for ^^^^^^^^^^^^^^^^^^^^^^^^^^ FRAMESET, FRAME, etc., too.

I've heard mention of the sample CSS, but have not encountered it
documented. Where can I find this? Is it a local css file stored with
the browser, or available at WC3?


As Jukka said, it is "in the CSS 2 specification".
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #6

P: n/a
Neal <ne*****@spamrcn.com> wrote:
On Fri, 2 Apr 2004 06:12:51 +0000 (UTC), Jukka K. Korpela
<jk******@cs.tut.fi> wrote:
And the sample style
sheet for HTML 4 in the CSS 2 specification sets some properties for
FRAMESET, FRAME, etc., too.


I've heard mention of the sample CSS, but have not encountered it
documented. Where can I find this? Is it a local css file stored with the
browser, or available at WC3? Or am I totally off?


It's part of the CSS spec, for example:
http://www.w3.org/TR/CSS21/sample.html
"Appendix A. A sample style sheet for HTML 4.0"

If you have Mozilla installed find html.css and have a look. That's
the default stylesheet used to render pages in that browser. Then look
at quirks.css and weep.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #7

P: n/a
On Fri, 02 Apr 2004 15:56:08 +0200, Johannes Koch <ko**@w3development.de>
wrote:
Neal wrote:
I've heard mention of the sample CSS, but have not encountered it
documented. Where can I find this? Is it a local css file stored with
the browser, or available at WC3?


As Jukka said, it is "in the CSS 2 specification".


Thanks for being mildly helpful.

As I've been combing through the specs for months, and for the last half
hour specifically, but unsuccessfully, looking for this, a URL to that
specific information might be really helpful.

Or, if it's not collected into one document, that information would save
me a bit of time as well. The phrasing of my post was meant to reflect
that possibility.
Jul 20 '05 #8

P: n/a
Neal <ne*****@spamrcn.com> wrote:
On Fri, 02 Apr 2004 15:56:08 +0200, Johannes Koch <ko**@w3development.de>
wrote:
Neal wrote:
I've heard mention of the sample CSS, but have not encountered it
documented. Where can I find this? Is it a local css file stored with
the browser, or available at WC3?
As Jukka said, it is "in the CSS 2 specification".


Thanks for being mildly helpful.

As I've been combing through the specs for months, and for the last half
hour specifically, but unsuccessfully, looking for this,


Really? So you looked at the home page of the CSS 2 spec?
http://www.w3.org/TR/CSS2/
And you looked at the table of contents part way down the page (linked
to from every page of the spec)?
http://www.w3.org/TR/CSS2/cover.html#minitoc
And you didn't see the item in the ToC that says
"Appendix A. A sample style sheet for HTML 4.0"
a URL to that specific information might be really helpful.


http://www.w3.org/TR/CSS2/sample.html

The changes between this version and the CSS 2.1 version I posted
earlier can be educational.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #9

P: n/a
On Fri, 02 Apr 2004 15:01:29 +0100, Steve Pugh <st***@pugh.net> wrote:
It's part of the CSS spec, for example:
http://www.w3.org/TR/CSS21/sample.html
"Appendix A. A sample style sheet for HTML 4.0"


Appreciated. I was looking through the CSS2, not the revision. It's
clearly available in the revision. Thanks.
Jul 20 '05 #10

P: n/a
On Fri, 02 Apr 2004 15:14:36 +0100, Steve Pugh <st***@pugh.net> wrote:

Really? So you looked at the home page of the CSS 2 spec?
http://www.w3.org/TR/CSS2/
And you looked at the table of contents part way down the page (linked
to from every page of the spec)?
http://www.w3.org/TR/CSS2/cover.html#minitoc
And you didn't see the item in the ToC that says
"Appendix A. A sample style sheet for HTML 4.0"
Believe it or not. My eyes must be going, there it is. Damn.

(In my defense, that's a hell of a long list and with such tight spacing
it all kind of runs together after a while...)
The changes between this version and the CSS 2.1 version I posted
earlier can be educational.


Indeed.

Thanks again.
Jul 20 '05 #11

P: n/a
On Fri, 02 Apr 2004 09:18:17 -0500, Neal <ne*****@spamrcn.com> wrote:
On Fri, 02 Apr 2004 15:14:36 +0100, Steve Pugh <st***@pugh.net> wrote:

Really? So you looked at the home page of the CSS 2 spec?
http://www.w3.org/TR/CSS2/
And you looked at the table of contents part way down the page (linked
to from every page of the spec)?
http://www.w3.org/TR/CSS2/cover.html#minitoc
And you didn't see the item in the ToC that says
"Appendix A. A sample style sheet for HTML 4.0"


Believe it or not. My eyes must be going, there it is. Damn.

(In my defense, that's a hell of a long list and with such tight spacing
it all kind of runs together after a while...)


Ctrl-F has its uses. (In Opera and IE anyway - doubtless all other
browsers have their equivalent.)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #12

P: n/a
Steve Pugh <st***@pugh.net> wrote:
If you have Mozilla installed find html.css and have a look. That's
the default stylesheet used to render pages in that browser. Then look
at quirks.css and weep.


Just to elaborate, quirks.css is *not* the stylesheet for QuirksMode
(that would be too obvious). QuirksMode is hard coded - quirks.css is
the stylesheet for "almost standards" mode. The next (7.5) version of
Opera will also feature 3 modes instead of two, and its equivalent
file is "browser.css".

--
Karl Smith.
Jul 20 '05 #13

P: n/a
go************@kjsmith.com (Karl Smith) wrote:
Steve Pugh <st***@pugh.net> wrote:
If you have Mozilla installed find html.css and have a look. That's
the default stylesheet used to render pages in that browser. Then look
at quirks.css and weep.
Just to elaborate, quirks.css is *not* the stylesheet for QuirksMode
(that would be too obvious). QuirksMode is hard coded - quirks.css is
the stylesheet for "almost standards" mode.


Are you sure? quirks.css contains some stuff (e.g. non-inheritence of
font sizes into tables) that's only done in Quirks mode not Almost
Standards mode.
The next (7.5) version of
Opera will also feature 3 modes instead of two, and its equivalent
file is "browser.css".


I've got 7.23 and 7.5p3 and I can't find a browser.css anywhere on my
system. Confused.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #14

P: n/a
Steve Pugh <st***@pugh.net> wrote:
go************@kjsmith.com (Karl Smith) wrote:
Steve Pugh <st***@pugh.net> wrote:
If you have Mozilla installed find html.css and have a look. That's
the default stylesheet used to render pages in that browser. Then look
at quirks.css and weep.


Just to elaborate, quirks.css is *not* the stylesheet for QuirksMode
(that would be too obvious). QuirksMode is hard coded - quirks.css is
the stylesheet for "almost standards" mode.


Are you sure? quirks.css contains some stuff (e.g. non-inheritence of
font sizes into tables) that's only done in Quirks mode not Almost
Standards mode.


Whoops. It's the other way around, "almost standards" is hard-coded
and quirks.css contains additional quirks to get from there to full
"QuirksMode".

I asked about this file years ago when I first discovered it, and
young Christopher Hoess told me it was part, but not all of
QuirksMode. I.e., I couldn't eliminate QuirksMode just by altering
quirks.css.

The next (7.5) version of
Opera will also feature 3 modes instead of two, and its equivalent
file is "browser.css".


I've got 7.23 and 7.5p3 and I can't find a browser.css anywhere on my
system. Confused.


Yes I was confused, sorry. Apparently all three modes are hard-coded
in Opera.

If created by the user, browser.css acts the same as a user stylesheet
except not the same (cascades after the user stylesheet and before the
hard-coded "stylesheet" - same place in the cascade as Mozilla's
quirks.css). I didn't know it had to be user created, and being easily
confused, I misunderstood its function. I've found this explanation:

http://groups.google.com/groups?q=+%...4ax.com&rnum=7

--
Karl Smith.
Jul 20 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.