Forum Moderators: not2easy

Message Too Old, No Replies

Help with Frames and CSS

make a frame of a painting with CSS show up in a browser

         

RicoSuave

6:31 pm on Sep 25, 2003 (gmt 0)

10+ Year Member



I have this site which contains a border like it is a frame around a painting. The good thing about this is that whenever someone tries to resize it the frame resizes with the browser. However, the bad thing is: it was made with frames a long time ago. I know how to make it with tables, but you guys here keep telling that styles are way better to use, so I want to try that. The problem is that I have kept on trying to make it work, but I just cannot figure out how....

the page consists out of 9 frames. 3 on top, 3 in the middle and 3 on the bottom.
like this thus:
¦ 1 ¦ 2 ¦ 3 ¦
¦ 4 ¦ 5 ¦ 6 ¦
¦ 7 ¦ 8 ¦ 9 ¦
Frame 5 is the content frame, the others make the painting's frame. I succeed in making frames 1 3 7 or 9. the hardest part is making the frames in between (2 4 6 & 8).

Who can give me any tips?
If my English or my explanation somehow troubled you, plz check out the old site on <Ooops!>

[edited by: Nick_W at 7:00 pm (utc) on Sep. 25, 2003]
[edit reason] no urls please / thanks! [/edit]

Nick_W

7:30 am on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh boy, frames really aren't my subject...

Anyone?

Nick

Spook

9:03 am on Sep 26, 2003 (gmt 0)

10+ Year Member



Hi RicoSuave and welcome to the forum.

If I understand you right, you have a picture in frame 5, and the remaining frames 1-4 and 6-9 are just decorative [in other words have no content, just color.]?

If this is the case you could place the picture in an appropriately sized div, aligned centrally in the view port. Then just give the background a color of your choice.

Does that sound about what you are looking for?

Spook.

wkitty42

9:19 am on Sep 26, 2003 (gmt 0)

10+ Year Member



frames are not that hard, really...

here's a tictactoe type grid similar to what rico is looking for... this one resizes all of the frames to maintain 33% height and width of the browser window for each one...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

<html>
<head>
<title>tic tac toe frames</title>
</head>
<frameset cols="33%, 33%, 33%" rows="33%, 33%, 33%">
<frame name="1a" src="1a.html">
<frame name="2a" src="2a.html">
<frame name="3a" src="3a.html">
<frame name="1b" src="1b.html">
<frame name="2b" src="2b.html">
<frame name="3b" src="3b.html">
<frame name="1c" src="1c.html">
<frame name="2c" src="2c.html">
<frame name="3c" src="3c.html">
<noframes>
<p>sorry, your browser doesn't do frames.</p>
</noframes>
</frameset>
</html>

this one, on the other hand, keeps the center frame (2b) set to 200px by 200px while all the others adjust shape and size as the browser window is resized...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

<html>
<head>
<title>tic tac toe frames</title>
</head>
<frameset cols="*, 200, *" rows="*, 200, *">
<frame name="1a" src="1a.html">
<frame name="2a" src="2a.html">
<frame name="3a" src="3a.html">
<frame name="1b" src="1b.html">
<frame name="2b" src="2b.html">
<frame name="3b" src="3b.html">
<frame name="1c" src="1c.html">
<frame name="2c" src="2c.html">
<frame name="3c" src="3c.html">
<noframes>
<p>sorry, your browser doesn't do frames.</p>
</noframes>
</frameset>
</html>

but it seems that rico already has something like this (the existing framed site)... rico, are you wanting to move away from frames and do this all in one page rather than 10 (1 index and 9 content) pages? if so and since you mention knowing how to do it with tables but wanting to do it with styles instead, it would seem so... however, you'd be nesting divs within divs within divs in an attempt to recreate what a table already does...

i'm not totally sure exactly what you are wanting to do ;(

[added]maybe spook has it... he got that in during the time i created, copied and pasted the two sets of code in this message, LOL![/added]

RicoSuave

5:01 pm on Sep 26, 2003 (gmt 0)

10+ Year Member



This is how the frameset looks like. The border frames (all except 5) show html pages which only contain a background image. The 8 border frames together look like the frame of a painting and when you resize the browser, the frame resizes along with it.

I also posted the same site which I made with tables. BUt I really want to let a stylesheet do the work.

FRAMESET:
-------------------
<frameset framespacing="0" border="false" frameborder="0" rows="30,*,29">
<frameset cols="26,*,26">
<frame name="lboven" scrolling="no" noresize target="contents" src="lijst/lbovenrand.htm">
<frame name="boven" scrolling="no" noresize target="contents" src="lijst/bovenrand.htm">
<frame name="rboven" scrolling="no" noresize target="contents" src="lijst/rbovenrand.htm">
</frameset>
<frameset cols="26,*,26">
<frame name="links" scrolling="no" noresize target="contents" src="lijst/linksrand.htm">
<frame name="start" src="html/start.htm" scrolling="no">
<frame name="rechts" src="lijst/rechtsrand.htm" scrolling="no" target="contents">
</frameset>
<frameset cols="26,100%,26">
<frame name="londer" scrolling="no" noresize target="contents" src="lijst/londerrand.htm">
<frame name="onder" scrolling="no" noresize target="contents" src="lijst/onderrand.htm" marginwidth="0">
<frame name="ronder" scrolling="no" noresize target="contents" src="lijst/ronderrand.htm">
<noframes>
</noframes>
</frameset>
<noframes>
<body>
some text here
</body>
</noframes>
</frameset>

TABLES:
-------------------------------------
<table width="100%" height="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center" background="../.././lijst/lboven.jpg">&nbsp;</td>
<td align="center" valign="bottom" background="../.././lijst/boven.jpg"><img src="../.././plaatjes/spacer.gif" height="30" width="1"></td>
<td align="center" background="../.././lijst/rboven.jpg">&nbsp;</td>
</tr>
<tr>
<td align="center" background="../.././lijst/links.jpg"><img src="../.././plaatjes/spacer.gif" width="26"></td>
<td align="center" height="100%" width="100%">inhoud</td>
<td align="center" background="../.././lijst/rechts.jpg"><img src="../.././plaatjes/spacer.gif" width="26"></td>
</tr>
<tr>
<td align="center" background="../.././lijst/londer.jpg">&nbsp;</td>
<td align="center" background="../.././lijst/onder.jpg"><img src="../.././plaatjes/spacer.gif" height="30" width="1"></td>
<td align="center" background="../.././lijst/ronder.jpg">&nbsp;</td>
</tr>
</table>

SuzyUK

8:45 am on Sep 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi RicoSuave..

3 parts(divs) will give you an expanding Picture frame Look

1. top of design - top corners and border
2. a background image(repeating along the y-axis) for the 2 x side borders
3. bottom of design - bottom border and corners.

Which is quite logical when you think header, content, footer layout

if you use the middle section (2) for content it will expand as necessary.

It can all be done with relative positioning so should remain stable.

Suzy

Spook

8:54 am on Sep 27, 2003 (gmt 0)

10+ Year Member



Hi.

I think the following will give you approximately what you have now, someone will jump in soon and correct me if I am missleading you.


css

body{
background : Gray;
}
#container{
border: 1px solid red;
margin: 30px 26px 30px 26px;
}
#frame{
background: transparent;
width: 760px;
position: absolute;
left: 50%;
margin-left: -380px;
margin-top: 10px;
margin-bottom: 20px;
border: 1px solid white;
}

And html

<body>
<div id="frame">
<div id="container">Picture Here</div>
</div>
</body>

If you play around with the colours, margins and borders you should be able to "tweak2 it to suit.

Still not sure if this is what you are looking for but hope this helps.

Spook

Spook

8:56 am on Sep 27, 2003 (gmt 0)

10+ Year Member



Sorry, SuzyUK can type [and think] quicker than me!

Spook

RicoSuave

4:49 pm on Sep 28, 2003 (gmt 0)

10+ Year Member



Unfortunately this is not the way :( , but thanks a lot for helping me so far. I posted a link to my site, since I was afraid it was hard to understand what I wanted but found out that this forum is well-moderated ;). It's really hard to explain if you don't see it.

If you guys want to know what I have right now, please contact me (Private message). You guys would make me a very happy man :D.