Tahoma
(1)
Greg
(1)
Mirandabelieve
(1)
Tlgalenson
(1)
Devolopers
(1)
W3schools
(1)
Wholepage
(1)
Selector
(1)

Want to "center" the page in the browser but let the text flow?

Asked By Tom Miller
17-Nov-09 04:00 PM
Folks,
I would like to have the page show up in the middle of the browser window.
I would like the background to "border around the displayed page."  I would
like the page proper to stand out by being another color.  For instance, the
basic background of the "border" might be white but the page in the center
might be a pure black background.

Here is the URL I am trying to convert into CSS.  http://www.ChatNFiles.com
Here is a URL that has something like what I am shooting for:
http://JewlerybyJulie.ChatNFiles.com  But it is tables-based.

Is this even possible?

Tom
--
Who me?  What signature?

I manage design and acquistion of data-driven websites at:
http://BlueCollar.ChatNFiles.com
Linkedin Profile: http://www.linkedin.com/in/tlgalenson
www.ChatNFiles.com has telnet chatting and more than 500,000 downloads

To center content in the middle of a page requires three things:1.

Cheryl D Wise replied to Tom Miller
17-Nov-09 04:22 PM
To center content in the middle of a page requires three things:

1. A valid doctype
2. A container with a defined width (div preferred by can be a table
specified in pixels, percents or ems)
3. Applied CSS selector with margin-left: auto; margin-right: auto.

Example:

width: 780px;
margin: 0 auto;
}


BTW, please do not cross post to newsgroups that are on different servers.
Not being subscribed to whatever css newsgroup you had in your cross posting
made it difficult to respond.

--
Cheryl D Wise
http://by-expression.com

Thank you.

Tom Miller replied to Cheryl D Wise
17-Nov-09 05:09 PM
Thank you.

Cross posting on newsgroups...

Tom Miller replied to Cheryl D Wise
17-Nov-09 05:12 PM
But, but, but.....  They both are on my news server...  but it had not
occurred to me that if I were trying to read this from say the microsoft
news server it would come back and byte me.
Sorry.
Tom
--
Who me?  What signature?

I manage design and acquistion of data-driven websites at:
http://BlueCollar.ChatNFiles.com
Linkedin Profile: http://www.linkedin.com/in/tlgalenson
www.ChatNFiles.com has telnet chatting and more than 500,000 downloads
Sorry, my mind is slower than light (make that mud) this afternoon.
Tom Miller replied to Cheryl D Wise
17-Nov-09 05:16 PM
Sorry, my mind is slower than light (make that mud)  this afternoon.
That takes care of the positioning.  My follow on question is how do I get
the background of the "container" to display "over the top" of the
background color command for the ?

Its making my head scratch.

Thanks,
Tom
That appears to work in the following.
Tom Miller replied to Tom Miller
17-Nov-09 06:19 PM
That appears to work in the following.  Setup the background color in the
Like this:

body {
margin: 0;
padding: 0;
font-family: Tahoma;
font-size: 11px;
background-color: white;
color: #EAF5FF;

Then use the

width: 780px;
margin: 0 auto;
background-color: black;
}

trick.  It sets up your page in the middle of the browser window with a
white border around the page!  Just what I was shooting for.

So now I have everything but the question of letting the text flow and
here it STILL looks VERY nice!
Thank you Cheryl!

Tom
--
Who me?  What signature?

I manage design and acquistion of data-driven websites at:
http://BlueCollar.ChatNFiles.com
Linkedin Profile: http://www.linkedin.com/in/tlgalenson
www.ChatNFiles.com has telnet chatting and more than 500,000 downloads
As you discovered adding a background to the container divs does what youwant.
Cheryl D Wise replied to Tom Miller
18-Nov-09 11:09 AM
As you discovered adding a background to the container divs does what you
want. Think of it as layering, parts that are not covered show.

Most of this is covered in the free self paced material at
http://w3schools.com in then css material especially when you combine it
with the html material. I also cover some of A in the Basic website Tutorial
and other tutorials in the site  shown in my signature.

--
Cheryl D Wise
http://by-expression.com
@newsfe10.iad:Most provider news servers are aggregates.
Gregory A. Beamer replied to Tom Miller
18-Nov-09 11:39 AM
@newsfe10.iad:


Most provider news servers are aggregates. Anything that is not microsoft.
will not appear here. It is not a huge issue, to me at least, but
newsreaders throw errors when you try to cross post back and do not have
access. ;-)

Peace and Grace,
Greg

--
Vote for Miranda's Christmas Story
http://tinyurl.com/mirandabelieve

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
|      Think outside the box!             |
*******************************************
I have been working through the CSS at w3schools but apparently I am going
Tom Miller replied to Cheryl D Wise
19-Nov-09 08:17 AM
I have been working through the CSS at w3schools but apparently I am going to
have to go back to the html tutorial too.

A devolopers learning curve is never done <sigh>.

Tom
--
Who me?  What signature?

I manage design and acquistion of data-driven websites at:
http://BlueCollar.ChatNFiles.com
Linkedin Profile: http://www.linkedin.com/in/tlgalenson
www.ChatNFiles.com has telnet chatting and more than 500,000 downloads
Post Question To EggHeadCafe