468,121 Members | 1,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,121 developers. It's quick & easy.

How do I select the BODY tag in a specific FRAME in a FRAMESET

Is there a way to write a CSS selector to point to the body tag in a
specific frame?

The frameset HTML looks like this. I only want to select the BODY tag
in the frame named "navbar" and then apply styles to that element.

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
CHARSET=iso-8859-1">
<TITLE>My Frameset</TITLE>
</HEAD>
<FRAMESET framespacing="3" cols="190,*">
<FRAME bordercolor="#3D5FA3" name="navbar" title="Navigation"
src="navbar.html" marginheight="0" marginwidth="0" scrolling="auto"
border="1">
<FRAME name="viewer" title="Contents" src="centents.html"
scrolling="auto">
<NOFRAMES>
<BODY>
<P>This page uses frames, but your browser doesn't support them.</P>
</BODY>
</NOFRAMES>

</FRAMESET>
</HTML>

Thanks,
Blake
Jul 21 '05 #1
12 5085
Els
Blake West wrote:
Is there a way to write a CSS selector to point to the body
tag in a specific frame?

The frameset HTML looks like this. I only want to select
the BODY tag in the frame named "navbar" and then apply
styles to that element.

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
CHARSET=iso-8859-1">
<TITLE>My Frameset</TITLE>
</HEAD>
<FRAMESET framespacing="3" cols="190,*">
<FRAME bordercolor="#3D5FA3" name="navbar"
title="Navigation" src="navbar.html" marginheight="0"
marginwidth="0" scrolling="auto" border="1">
<FRAME name="viewer" title="Contents" src="centents.html"
scrolling="auto">
<NOFRAMES>
<BODY>
<P>This page uses frames, but your browser doesn't support
them.</P> </BODY>
</NOFRAMES>

</FRAMESET>
</HTML>

Thanks,
Blake


In navbar.html you have <body>, and that's where you apply the
styles. I'm imagining you use a seperate stylesheet, so you'd
have to add a class to that <body> element. Just like you
would to any other element.

Oh, and btw, you could try losing the frames.
I've heard they're evil :-)
http://www.google.com/search?q="frames+are+evil"

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
Now playing: A-HA - Hunting High And Low
Jul 21 '05 #2

"Blake West" <bl*******@gmail.com> wrote in message
news:b2*************************@posting.google.co m...
Is there a way to write a CSS selector to point to the body tag in a
specific frame?

The frameset HTML looks like this. I only want to select the BODY tag
in the frame named "navbar" and then apply styles to that element.


Styles defined in a frameset document only apply to content inside the
NOFRAMES element. The appearance of the document in each frame is governed
by the styles defined in the document.

Jul 21 '05 #3
On 27 Oct 2004 18:35:27 GMT, Els <el*********@tiscali.nl> wrote:
Blake West wrote:
Is there a way to write a CSS selector to point to the body tag in a
specific frame?

Stylesheets only apply to the document that contains them. Add the LINK
(or STYLE, if you must) element to the file in that frame, and style as
required.

body {
/* ... */
}

[snip]
Oh, and btw, you could try losing the frames.
I've heard they're evil :-)
http://www.google.com/search?q="frames+are+evil"


Try:

<URL:http://www.google.com/search?q=%22frames+are+evil%22>

:)

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #4
On 27 Oct 2004 11:28:53 -0700, bl*******@gmail.com (Blake West) wrote:
Is there a way to write a CSS selector to point
to the body tag in a specific frame?
What's with this sudden obsession with a stone age technique here in
this NG?
...frameset HTML looks...only want to select the BODY tag
in the frame named "navbar"...
Formally you don't select tags, CSS selectors selects elements and
applies formatting style rules to the content of matching elements and
optionally also to the containing box that is created for an element.

You will never develop a good understanding of how CSS is meant to work
unless you first develop an understanding of how markup is meant to
work.

[...]
<BODY>
<P>This page uses frames, but your browser doesn't support them.</P>
</BODY>


Either you are joking or trolling. Either way, learn that what my
browser(s) can, and can not, do is none of your business.

This is your next exercise; search Google for the exact quoted line...

"This page uses frames, but your browser doesn't support them"

I got 3260000 hits and I could easily bet my bottom dollar on every one
of those URL's to represent something equally clueless and useless.

Framed sites are the enemies of search engines.
Framed sites can not be properly book marked.
Framed sites are the enemy of one of the best browsers in the world.
Framed sites should not be created given available techniques of today.

Go here, grab a bit of knowledge and allow yourself to be amazed...

<http://webhost.bridgew.edu/etribou/layouts/>

--
Rex
Jul 21 '05 #5
On Wed, 27 Oct 2004, Jan Roland Eriksson wrote:
"This page uses frames, but your browser doesn't support them"

I got 3260000 hits and I could easily bet my bottom dollar on every
one of those URL's to represent something equally clueless and
useless.


Some of them are tutorials warning against such nonsense!

SCNR.

Jul 21 '05 #6
On 27 Oct 2004 11:28:53 -0700, Blake West <bl*******@gmail.com> wrote:
<NOFRAMES>
<BODY>
<P>This page uses frames, but your browser doesn't support them.</P>
</BODY>
</NOFRAMES>


<noframes>
<body>
<h1>The Wacky Doodle Website</h1>
<p>Thanks for visiting! Here's a site map of what we have to offer.</p>
<p>Click away, sucker!!1!11!!ELEVEN!!</p>
<ul>
<li><a href="wacky.html">Wacky</a></li>
<li><a href="doodle.html">Doodle</a></li>
<li><a href="dacky.html">Dacky</a></li>
<li><a href="woodle.html">Woodle</a></li>
</ul>
</body>
</noframes>

What is wrong with doing that???

"Oh, no, you don't have frames, get the hell out! Scram!!"
Jul 21 '05 #7
On 27 Oct 2004, Blake West wrote:
<NOFRAMES>
<P>This page uses frames, but your browser doesn't support them.</P>
</NOFRAMES>


ALT="This page uses images, but your browser doesn't support them."

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 21 '05 #8
On Thu, 28 Oct 2004, Andreas Prilop wrote:
On 27 Oct 2004, Blake West wrote:
<NOFRAMES>
<P>This page uses frames, but your browser doesn't support them.</P>
</NOFRAMES>


ALT="This page uses images, but your browser doesn't support them."

I'd re-word it more like "This page uses frames, but our web deezyner
doesn't understand how to support them".
Jul 21 '05 #9
To clarify:

I'm an end user stuck using three instances of Microsoft Outlook Web
Access for work. One for my employer and two for different clients.
They all look the same, and I keep getting confused.

I use Firefox and can apply user-defined styles based on a domain. So
I wanted to style each email interface differently so I could tell
them apart. The stylesheet is not referenced by any of the pages,
frameset page or content pages, but is instead applied by the browser.
I'm just trying to apply a particular end-user style sheet.

I think there has to be a way to use CSS selectors to point to the
content in a specific frame. If I figure it out, I'll post it back
here.

Microsoft is the one that uses the frames, not me.

Thanks for the comments.

-Blake
Jul 21 '05 #10
On 28 Oct 2004, Blake West wrote:
Microsoft is the one that uses the frames, not me.


I couldn't find "frameset" in line 1 of the source text of
http://www.microsoft.com .

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 21 '05 #11
Blake West wrote;
To clarify: I use Firefox and can apply user-defined styles based on a domain. So
I wanted to style each email interface differently so I could tell
them apart. The stylesheet is not referenced by any of the pages,
frameset page or content pages, but is instead applied by the browser.
I'm just trying to apply a particular end-user style sheet.
Yes, sometimes websites just must be fixed clientside. How does one set
up FF to have domain specific stylesheet?
I think there has to be a way to use CSS selectors to point to the
content in a specific frame.
Not possible. That doesn't mean that you can't do what you want...
If I figure it out, I'll post it back
here.
There must URLs in those files, that differ from one another, but stay
always same? Or something other unique stuff?
You can style using them. In firefox, you can also use some CSS3
selectors, which makes it easier.

a[href="example.example/?foobar"] {color: red;}

for

<a href="example.example/?foobar">adfs</a>

My dated page
http://www.student.oulu.fi/~laurirai...ss/userstyles/

(examples don't work anymore)

Another good bet is body[onload="whatever"]

Havent tested userstyle exept in Opera 6+
Microsoft is the one that uses the frames, not me.


Which you should have said in the firstplace. Because it changes
everything. In here, as this is www.authoring in group name, we always
assume web authoring, unless otherwise mentioned. Especially when post
looks like it was done by newbie.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #12
Lauri Raittila <la***@raittila.cjb.net> wrote...
Yes, sometimes websites just must be fixed clientside. How does one set
up FF to have domain specific stylesheet?


Use the uriID extension (I'm using Firefox 1.0PR)
http://extensionroom.mozdev.org/more-info/uriid

I wound up just settling with applying the following styles in my
userContent.css file:

body#mail-urlnumberone-com {background-color:red;}
body#mail-urlnumbertwo-com {background-color:green;}
body#mail-urlnumberthree-com {background-color:black;}

These styles get applied to the body tags in both frames. It would
look better if I could just apply the styles to one of the two frames,
but I'm happy with the solution.

My co-worker that uses IE is a little jealous.

BTW folks seem to be kinda touchy about the whole frames thing.
Jul 21 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Robert Oschler | last post: by
6 posts views Thread by skubik | last post: by
5 posts views Thread by Frame | last post: by
2 posts views Thread by jascraig | last post: by
18 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.