Forum Home
Press F1
 
Thread ID: 107517 2010-02-19 07:06:00 CSS Background - noob question WarNox (8772) Press F1
Post ID Timestamp Content User
859920 2010-02-19 07:06:00 Hey!

I've tried googling this but am yet to find a solution.

I want a background (colour or image) to apply to the whole site and be visible through all the frames, regardless of which page the user is viewing. I tried putting something like:


<style type="text/css">
body
{
background-color:#b0c4de;
}
</style>

in the "index.html" file where all the frames are defined (in the <HEAD> tag) but that doesn't work :)

Thanks for any help!
WarNox (8772)
859921 2010-02-19 07:38:00 This code needs to be in each page, rather than in the page defining the frameset.

Alternatively you could put this in a css file and include that in each page.
nate (15033)
859922 2010-02-19 07:41:00 This code needs to be in each page, rather than in the page defining the frameset.

Alternatively you could put this in a css file and include that in each page.

That would be the better option - it's much easier changing six characters of one file than changing six characters of six(ty) files. ;)
pcuser42 (130)
859923 2010-02-19 08:09:00 Yeah I though of that, but if I do it that way you'll be able to see a break between the frames unless its one solid colour. WarNox (8772)
859924 2010-02-19 08:10:00 Not if the frame border is zero. pcuser42 (130)
859925 2010-02-19 08:26:00 But yes if my frames are:

AAAAA
------
B|CCC
B|CCC
B|CCC


:)
WarNox (8772)
859926 2010-02-19 08:33:00 Hmm, maybe not then. pcuser42 (130)
859927 2010-02-19 10:23:00 Nothing stopping you including the CSS file in both the frameset document *and* the sub-documents... Erayd (23)
859928 2010-02-19 11:05:00 Can I ask why you are using frames in the first place? Very uncommon nowadays. nate (15033)
859929 2010-02-19 19:16:00 But yes if my frames are:

AAAAA
------
B|CCC
B|CCC
B|CCC


:)

Had a bit of a play around, and yes the frame border can be eliminated (www.imagef1.net.nz).



<html>
<head>
<title>Frame Type 1</title>
</head>
<frameset rows="100,*" frameborder=no>
<frame src="frame_files/framein_a.htm">
<frameset cols="200,*" frameborder=no>
<frame src="frame_files/framein_b.htm">
<frame src="frame_files/framein_c.htm">
</frameset>
</frameset>
</html>
pcuser42 (130)
1 2