Click to See Complete Forum and Search --> : Newbie page border question


grindy
04-24-2004, 07:10 PM
So far I have read about tables and frames, but not sure what the best way is to do the following:

I want to have a narrow border around my page ( lets say about 1/2" all around ), that will "auto-resize" depending on the user's current resolution.

I know that a cell in a table can be set to 100%, and that it will "auto-size" according to browser window size.

What I'd like to know from you non-newbies out there is just what is the most efficient way to do this?

Should I use a frame or a table, or is there some way to simply have an autosizing border without using either.

All advice appreciated ( except the ones that tell me to RTFM, which I have been doing ). :confused:

Nedals
04-24-2004, 07:54 PM
No frames..

In your <head> section, include...
<style type="text/css">
body {
margin:2%;
}
</style>
Change the percent value to what you need.

jdavia
04-24-2004, 08:34 PM
This is the way I would do it. I don't mind comments.

<body bgcolor="#80ffff" text="#004080">
<div align="center">
<table width="95%"height="95%" border="1" cellspacing="0" cellpadding="10" bgcolor="#80ffff" bordercolor="#000000">
<tr>
<td >
<div align="justify"> You can make a frame around your page using the table settings themselves. IE and NS will show them slightly different because of the scrollbar. <br>IE shown it even if there is no scroll. NS don't show it, but extends the background color, making the table look off center.<br>
Feel free to change any of the table settings.</div>
</td>
</tr>
</table></div>

IncaWarrior
04-25-2004, 12:17 AM
i like Nedals' way better

jdavia
04-25-2004, 02:02 AM
Did you run it?
It does not center. I think it needs more code.

Nedals
04-25-2004, 10:51 AM
Originally posted by jdavia
Did you run it?
It does not center. I think it needs more code.
Try it with that 'inner' <div> only (not the table) that you included with your post.
The original poster did not request a centering method.
Originally posted by grindy
I want to have a narrow border around my page

ray326
04-25-2004, 01:26 PM
Well since you don't mind comments, there is no tabular data so a table is the wrong markup. Align is a deprecated attribute. Also, the text in your div should be in paragraphs rather than raw with breaks.

jdavia
04-26-2004, 01:04 AM
Thanks for the comments, but,
there is no tabular data so a table is the wrong markup.
Demonstrate it. He is asking about tables.

Align is a deprecated attribute. It still works though. Show an attribute that replaces it.

Also, the text in your div should be in paragraphs rather than raw with breaks
I didn't want a new paragraph, just a line break. The text wasn't grindy's question, the border was.
Just exactly how would you do it?

ray326
04-26-2004, 02:49 PM
Demonstrate it. He is asking about tables. No, he's asking about layout.
It still works though. Show an attribute that replaces it. Look up "deprecated". It is replace by the text-align style.
I didn't want a new paragraph, just a line break. Whether you wanted it or not, what you PUT there was a paragraph and should be marked up as such.
Just exactly how would you do it? The way nedals did except I would've put margin: .5in; because that's what he asked for.

fredmv
04-26-2004, 04:11 PM
Only one comment: it is considered good practice to apply whatever rules you have to the <body>, to <html> as well because when served as an application of XML they simply aren't the same thing so you may get undesired results.<style type="text/css">
/*<![CDATA[*/
html, body { margin: .5in; }
/*]]>*/
</style>

Nedals
04-26-2004, 07:08 PM
Originally posted by ray326
The way nedals did except I would've put margin: .5in; because that's what he asked for.
Not Quite! :)
Originally posted by grindy
...( lets say about 1/2" all around ), that will "auto-resize" depending on the user's current resolution.

grindy
04-26-2004, 07:43 PM
Forgive me, but I just love it when the experts challange each other...
It's when I really learn the MOST !

I truly thank all of you:)

ray326
04-27-2004, 12:45 AM
Originally posted by Nedals
Not Quite! :) I defer to the more accurate reader. ;)