Centering a layer within a page?

G

Guest

I am building a webpage where I decided to put all text and images within a
layer. I am creating a webpage very similiar to caffezingaro.com. I am pretty
new at this and truly trying to learn code instead of just building from the
split screen. My idea is to isolate the paragraph and pics in the layer and
center everything for ease of reading on all browsers and I have centered the
header and top banner pic. The <p> color is also different then the page
color which again is similiar to the zingaro page. Any help would be greatly
appreciated. I am learning this pretty quickly but my only drawback has been
the whole lining up process. Thanks all.

Larry
 
T

Tom

A layer is an Absolute positioned <div> and is based on the 0,0 coordinates
of the nearest
positioned ancestor. This is not what you want/need...

But you can use a relative positioned <div> and CSS to do this.

Change this -

</head>

to this -

<style type="text/css">
<!--
body {
text-align:center;
}
#wrapper {
text-align:left;
width:740px;
margin:0 auto;
position:relative;
}
-->
</style>
</head>

change this -

<body ...>

to this -

<body ...>
<div id="wrapper">

and this -

</body>

to this -

</div><!-- /wrapper -->
</body>

That will give you a wrapper / container 740px wide and centered on the page
no matter what the OP's viewport size is.

Tom
|I am building a webpage where I decided to put all text and images within a
| layer. I am creating a webpage very similiar to caffezingaro.com. I am
pretty
| new at this and truly trying to learn code instead of just building from
the
| split screen. My idea is to isolate the paragraph and pics in the layer
and
| center everything for ease of reading on all browsers and I have centered
the
| header and top banner pic. The <p> color is also different then the page
| color which again is similiar to the zingaro page. Any help would be
greatly
| appreciated. I am learning this pretty quickly but my only drawback has
been
| the whole lining up process. Thanks all.
|
| Larry
 
G

Guest

Two more questions and I will leave all alone for the rest of the day!! How
do I put color to the left and right of the text that I just centered and how
do I spruce up my Nav bar to get rid of the blue text. Tom thank you so
much!! This is such a great resource.

One more. What would you really use layers for other than photos?
 
T

Tom

The body color is what you will see to the right and left of the
container...

Using the CSS example I gave...

<style type="text/css">
<!--
body {
text-align:center;
background: #2293FF;
}
#wrapper {
text-align:left;
width:740px;
margin:0 auto;
position:relative;
}
-->
</style>

Change the RGB numbers of #2293FF to suit your needs
(If you don't want the center to be that too!)
Then add a background to the container using another RGB color
(Adjusting to your needs).
Like...

<style type="text/css">
<!--
body {
text-align:center;
background: #2293FF;
}
#wrapper {
text-align:left;
width:740px;
margin:0 auto;
position:relative;
background: #2222FF;
}
-->
</style>

Hope this helps some

Tom

| Two more questions and I will leave all alone for the rest of the day!!
How
| do I put color to the left and right of the text that I just centered and
how
| do I spruce up my Nav bar to get rid of the blue text. Tom thank you so
| much!! This is such a great resource.
|
| One more. What would you really use layers for other than photos?
|
| "larman" wrote:
|
| > I am building a webpage where I decided to put all text and images
within a
| > layer. I am creating a webpage very similiar to caffezingaro.com. I am
pretty
| > new at this and truly trying to learn code instead of just building from
the
| > split screen. My idea is to isolate the paragraph and pics in the layer
and
| > center everything for ease of reading on all browsers and I have
centered the
| > header and top banner pic. The <p> color is also different then the page
| > color which again is similiar to the zingaro page. Any help would be
greatly
| > appreciated. I am learning this pretty quickly but my only drawback has
been
| > the whole lining up process. Thanks all.
| >
| > Larry
 
T

Tom

Forgot about the Layers...

We will start with "Layers are BAD"
and then move on to an explanation of layers so you will better understand.
============================
Layers are bad.

Layers are bad because they are absolutely positioned. As such, they have
several "undesirable" characteristics (particularly for those who do not
understand HTML and CSS/positioning):

1. A layer floats over (in the z-direction, i.e., vertically out of the
page) other page content. Thus it can mask mouse events on that other page
content - this is what is responsible for problem with the non-functional
link underneath one.

2. Because a layer floats over other page content, it cannot interact with
that other page content - thus when the text content in a layer is resized
in the browser, causing the layer to expand vertically, the text will start
to overlap the other page content, leading to an unusable mess in the
browser.

3. Because a layer is absolutely positioned, it stays fixed on the screen
while other content which may be within a percent sized container is free to
move around. Unless you are familiar enough with CSS to know how to
accommodate this flexibility, you will probably post a question here called
"Why are my layers moving?". Then everyone can post replies telling you that
layers don't move....

4. Because a layer is absolutely positioned, if it is contained within a
flexible container, if the container flexes, the layer will flex with it,
perhaps causing images within that layer to overlap other underlying page
content.

Layers are very seductive because they are easy to place on the page.
This ease of placement extracts a VERY heavy price in terms of page
usability and functionality. It's best to not use them at all until you
understand enough HTML and CSS to manage the page without layers. Most
experienced developers
use absolute positioned elements quite sparingly if at all..

==========================
Layers

This may help you understand positioning a bit -

There are 4 different types of positioning:
Absolute
Relative
Fixed
Static

Here is a brief explanation of each kind of positioning (with regard to
placement of elements on the page only)....

Position:absolute (or A/P elements)
-----------------------
This does several things -
1. It 'removes' the element from the flow of the code on the­ page so that
it can no longer influence the size or position of any other pa-ge element
(except for those contained within it, of course).

2. The absolutely positioned element takes its position from the position of
its closest PA­RENT *positioned* element - in the absence of any explicitly
positioned parent, this will default to the <body> tag, which is always
positioned ­at 0,0 in the browser viewport.

This means that it doesn't matter where in the HTML code the laye­r's code
appears (between <body> and </body>), its location on the screen will not
change (this assumes that you have not positioned the A/P element within a
table or another A/P element, of course). Furthe­rmore, the space in
which this element would have appeared were it not positi­oned is not
preserved on the screen. In other words, absolutely positioned elements
don't take up any space on the page. In fact, they FLOAT over the page.

Position:relative (or R/P elements)
----------------------
In contrast to absolute positioning, a relatively positioned page element is
*not* removed from t­he flow of the code on the page, so it will use the
spot where it would have­ appeared based on its position in the code as its
zero point reference. If­ you then supply top, right, bottom, or left
positions
to the style for this ­element, those values will be used as offsets from
its zero point.

This means that it DOES matter where in the code the relativ­ely positioned
element appears (, as it will be positioned in that location (­factoring in
the offsets) on the screen (this is true for any placement in the code).
Furthermore, the space where this e­lement would have appeared is preserved
in the display, and can therefore­ affect the placement of succeeding
elements. This means that the taller a relatively
positioned element is, the more space it forces on the page.

Position:static
-------------------
As with relative position, static positions also "go with ­the flow". An
element with a static position cannot have values for offset­s (top, right,
left, bottom) or if it has them, they will be ignored. Unless explicitly
positioned, all div elements default to static positioning.

Position:fixed
------------------
A page element with this style will not scroll as the page c­ontent scrolls.
Support for this in elements other than page backgrounds is ­quirky

There are several other things you need to know:

1. ANY page element can be positioned - paragraphs, tables, images, lists,
etc.
2. The <div> tag is a BLOCK level tag. This means that if it is not
positioned or explicitly styled otherwise,
a) it will always begin on a new line on the screen, and
b) it will always force content to a new line below it, and
c) it will always take up the entire width of its container (i.e.,
width:100%).
3. The placement of A/P elements *can* affect the BEHAVIOR of other elements
on the page. For example, a 'layer' placed over a hyperlink will mask that
hyperlink.

===============================

Tom
| The body color is what you will see to the right and left of the
| container...
|
| Using the CSS example I gave...
|
| <style type="text/css">
| <!--
| body {
| text-align:center;
| background: #2293FF;
| }
| #wrapper {
| text-align:left;
| width:740px;
| margin:0 auto;
| position:relative;
| }
| -->
| </style>
|
| Change the RGB numbers of #2293FF to suit your needs
| (If you don't want the center to be that too!)
| Then add a background to the container using another RGB color
| (Adjusting to your needs).
| Like...
|
| <style type="text/css">
| <!--
| body {
| text-align:center;
| background: #2293FF;
| }
| #wrapper {
| text-align:left;
| width:740px;
| margin:0 auto;
| position:relative;
| background: #2222FF;
| }
| -->
| </style>
|
| Hope this helps some
|
| Tom
|
| || Two more questions and I will leave all alone for the rest of the day!!
| How
|| do I put color to the left and right of the text that I just centered and
| how
|| do I spruce up my Nav bar to get rid of the blue text. Tom thank you so
|| much!! This is such a great resource.
||
|| One more. What would you really use layers for other than photos?
||
|| "larman" wrote:
||
|| > I am building a webpage where I decided to put all text and images
| within a
|| > layer. I am creating a webpage very similiar to caffezingaro.com. I am
| pretty
|| > new at this and truly trying to learn code instead of just building
from
| the
|| > split screen. My idea is to isolate the paragraph and pics in the layer
| and
|| > center everything for ease of reading on all browsers and I have
| centered the
|| > header and top banner pic. The <p> color is also different then the
page
|| > color which again is similiar to the zingaro page. Any help would be
| greatly
|| > appreciated. I am learning this pretty quickly but my only drawback has
| been
|| > the whole lining up process. Thanks all.
|| >
|| > Larry
|
|
 
G

Guest

Tom,

Thank you so much for all your help. Two more questions and I will leave you
alone. How would I change nav colors as far as the blue default on nav text.
I actually built it as follows:

<div id="navigation">
<div align="center">
<span class="style1"><a href="index.htm">|Home</a>|
<a href="baristas.htm">Baristas|</a>|
<a href="coffee.htm">Coffee</a>|
<a href="desserts.htm">Desserts</a>|
<a href="art.htm">Art</a>|
<a href="music.htm">Music</a>|
<a href="contacts.htm">Contact</a>|</span></div>
</div>

AND how do I bring the center all the way up to the top and bottom of the
webpage.

Thanks again and have a great rest of the weekend.
 
T

Tom

Blue text in nav bar? Not sure exactly BUT
Try a bit more CSS to color the links the way you want.
Added more........
<style type="text/css">
<!--
body {
text-align:center;
background: #2293FF;
}
#wrapper {
text-align:left;
width:740px;
margin:0 auto;
position:relative;
color: #2222FF;
}
a {
text-decoration: none;
border: none;
font: medium "Times New Roman", Times, serif;
color: #000000;
background-color: transparent;
}
a:link {
text-decoration: none;
}
a:visited {
color: #000088;
}

a:hover {
color: #FF0000;
}
-->
</style>

This is black text then on hover Red. Then visited dark blue...
Change the RGB color code to make them what you want...

HTH

Tom

| Two more questions and I will leave all alone for the rest of the day!!
How
| do I put color to the left and right of the text that I just centered and
how
| do I spruce up my Nav bar to get rid of the blue text. Tom thank you so
| much!! This is such a great resource.
|
| One more. What would you really use layers for other than photos?
|
| "larman" wrote:
|
| > I am building a webpage where I decided to put all text and images
within a
| > layer. I am creating a webpage very similiar to caffezingaro.com. I am
pretty
| > new at this and truly trying to learn code instead of just building from
the
| > split screen. My idea is to isolate the paragraph and pics in the layer
and
| > center everything for ease of reading on all browsers and I have
centered the
| > header and top banner pic. The <p> color is also different then the page
| > color which again is similiar to the zingaro page. Any help would be
greatly
| > appreciated. I am learning this pretty quickly but my only drawback has
been
| > the whole lining up process. Thanks all.
| >
| > Larry
 
T

Tom

The last post I messed up the wrapper color... SO

This will take it to the top of the page too...

<style type="text/css">
<!--
body {
text-align:center;
background: #2293FF;
margin: 0;
}
#wrapper {
text-align:left;
width:740px;
margin:0 auto;
position:relative;
background-color: #2222FF;
}
a {
text-decoration: none;
border: none;
color: #000000;
background-color: transparent;
}
a:link {
text-decoration: none;
}
a:visited {
color: #000088;
}

a:hover {
color: #FF0000;
}
-->
</style>

Have a nice day....

Tom

| Tom,
|
| Thank you so much for all your help. Two more questions and I will leave
you
| alone. How would I change nav colors as far as the blue default on nav
text.
| I actually built it as follows:
|
| <div id="navigation">
| <div align="center">
| <span class="style1"><a href="index.htm">|Home</a>|
| <a href="baristas.htm">Baristas|</a>|
| <a href="coffee.htm">Coffee</a>|
| <a href="desserts.htm">Desserts</a>|
| <a href="art.htm">Art</a>|
| <a href="music.htm">Music</a>|
| <a href="contacts.htm">Contact</a>|</span></div>
| </div>
|
| AND how do I bring the center all the way up to the top and bottom of the
| webpage.
|
| Thanks again and have a great rest of the weekend.
|
|
|
| "Tom" wrote:
|
| > A layer is an Absolute positioned <div> and is based on the 0,0
coordinates
| > of the nearest
| > positioned ancestor. This is not what you want/need...
| >
| > But you can use a relative positioned <div> and CSS to do this.
| >
| > Change this -
| >
| > </head>
| >
| > to this -
| >
| > <style type="text/css">
| > <!--
| > body {
| > text-align:center;
| > }
| > #wrapper {
| > text-align:left;
| > width:740px;
| > margin:0 auto;
| > position:relative;
| > }
| > -->
| > </style>
| > </head>
| >
| > change this -
| >
| > <body ...>
| >
| > to this -
| >
| > <body ...>
| > <div id="wrapper">
| >
| > and this -
| >
| > </body>
| >
| > to this -
| >
| > </div><!-- /wrapper -->
| > </body>
| >
| > That will give you a wrapper / container 740px wide and centered on the
page
| > no matter what the OP's viewport size is.
| >
| > Tom
| > | > |I am building a webpage where I decided to put all text and images
within a
| > | layer. I am creating a webpage very similiar to caffezingaro.com. I am
| > pretty
| > | new at this and truly trying to learn code instead of just building
from
| > the
| > | split screen. My idea is to isolate the paragraph and pics in the
layer
| > and
| > | center everything for ease of reading on all browsers and I have
centered
| > the
| > | header and top banner pic. The <p> color is also different then the
page
| > | color which again is similiar to the zingaro page. Any help would be
| > greatly
| > | appreciated. I am learning this pretty quickly but my only drawback
has
| > been
| > | the whole lining up process. Thanks all.
| > |
| > | Larry
| >
| >
| >
 
V

Viken Karaguesian

Tom,

I don't understand this code :>( If you could expand on this a bit, I
would appreciate it. Some points of interest for me:

1) Why position:relative? Wouldn't it be enough to just set the width and
right/left margin to auto?

2) Why is this code (below) placed inside a comment? Are you trying to hide
it from another browser?
<style type="text/css">
<!--
body {
text-align:center;
}
#wrapper {
text-align:left;
width:740px;
margin:0 auto;
position:relative;
}
-->
</style>

3) Same question about this code:
</div><!-- /wrapper -->
</body>

I'm no expert, but I have a more-than-basic understanding of CSS and HTML. I
can't quite figure out the purpose behind this code. If you could explain
the concept behind this code, I'd appreciate it. The more I learn, the
happier I am :>)
 
T

Tom

Looking at it more closely....
You might want to add a space before the closeting </a> tag to make it more
even.
like

<div id="navigation">
<div align="center">
<span class="style1"><a href="index.htm">| Home </a>|
<a href="baristas.htm">Baristas </a>|
<a href="coffee.htm">Coffee </a>|
<a href="desserts.htm">Desserts </a>|
<a href="art.htm">Art </a>|
<a href="music.htm">Music </a>|
<a href="contacts.htm">Contact </a>|</span></div>
</div>

ave a good night

Tom
| The last post I messed up the wrapper color... SO
|
| This will take it to the top of the page too...
|
| <style type="text/css">
| <!--
| body {
| text-align:center;
| background: #2293FF;
| margin: 0;
| }
| #wrapper {
| text-align:left;
| width:740px;
| margin:0 auto;
| position:relative;
| background-color: #2222FF;
| }
| a {
| text-decoration: none;
| border: none;
| color: #000000;
| background-color: transparent;
| }
| a:link {
| text-decoration: none;
| }
| a:visited {
| color: #000088;
| }
|
| a:hover {
| color: #FF0000;
| }
| -->
| </style>
|
| Have a nice day....
|
| Tom
|
| || Tom,
||
|| Thank you so much for all your help. Two more questions and I will leave
| you
|| alone. How would I change nav colors as far as the blue default on nav
| text.
|| I actually built it as follows:
||
|| <div id="navigation">
|| <div align="center">
|| <span class="style1"><a href="index.htm">|Home</a>|
|| <a href="baristas.htm">Baristas|</a>|
|| <a href="coffee.htm">Coffee</a>|
|| <a href="desserts.htm">Desserts</a>|
|| <a href="art.htm">Art</a>|
|| <a href="music.htm">Music</a>|
|| <a href="contacts.htm">Contact</a>|</span></div>
|| </div>
||
|| AND how do I bring the center all the way up to the top and bottom of the
|| webpage.
||
|| Thanks again and have a great rest of the weekend.
||
||
||
|| "Tom" wrote:
||
|| > A layer is an Absolute positioned <div> and is based on the 0,0
| coordinates
|| > of the nearest
|| > positioned ancestor. This is not what you want/need...
|| >
|| > But you can use a relative positioned <div> and CSS to do this.
|| >
|| > Change this -
|| >
|| > </head>
|| >
|| > to this -
|| >
|| > <style type="text/css">
|| > <!--
|| > body {
|| > text-align:center;
|| > }
|| > #wrapper {
|| > text-align:left;
|| > width:740px;
|| > margin:0 auto;
|| > position:relative;
|| > }
|| > -->
|| > </style>
|| > </head>
|| >
|| > change this -
|| >
|| > <body ...>
|| >
|| > to this -
|| >
|| > <body ...>
|| > <div id="wrapper">
|| >
|| > and this -
|| >
|| > </body>
|| >
|| > to this -
|| >
|| > </div><!-- /wrapper -->
|| > </body>
|| >
|| > That will give you a wrapper / container 740px wide and centered on the
| page
|| > no matter what the OP's viewport size is.
|| >
|| > Tom
|| > || > |I am building a webpage where I decided to put all text and images
| within a
|| > | layer. I am creating a webpage very similiar to caffezingaro.com. I
am
|| > pretty
|| > | new at this and truly trying to learn code instead of just building
| from
|| > the
|| > | split screen. My idea is to isolate the paragraph and pics in the
| layer
|| > and
|| > | center everything for ease of reading on all browsers and I have
| centered
|| > the
|| > | header and top banner pic. The <p> color is also different then the
| page
|| > | color which again is similiar to the zingaro page. Any help would be
|| > greatly
|| > | appreciated. I am learning this pretty quickly but my only drawback
| has
|| > been
|| > | the whole lining up process. Thanks all.
|| > |
|| > | Larry
|| >
|| >
|| >
|
|
 
T

Tom

Reply inline>

Tom
| Tom,
|
| I don't understand this code :>( If you could expand on this a bit, I
| would appreciate it. Some points of interest for me:
|
| 1) Why position:relative? Wouldn't it be enough to just set the width and
| right/left margin to auto?

A relatively positioned page element is *not* removed from t­he flow of the
code on the page, so it will use thespot where it would have­ appeared based
on its position in the code as its zero point reference. If­ you then supply
top, right, bottom, or left positions to the style for this ­element, those
values will be used as offsets from its zero point.

(You could put elements above this such as <h1> That will expand the width
of the viewport 8)

This means that it DOES matter where in the code the relativ­ely positioned
element appears (, as it will be positioned in that location (­factoring in
the offsets) on the screen (this is true for any placement in the code).
Furthermore, the space where this e­lement would have appeared is preserved
in the display, and can therefore­ affect the placement of succeeding
elements. This means that the taller a relatively positioned element is, the
more space it forces on the page.


| 2) Why is this code (below) placed inside a comment? Are you trying to
hide
| it from another browser?
---snip---

Just an old style block that I have in FrontPage code snipets...
And yes it was to hide it from older browsers that couldn't handle CSS.

I need to update that - - Most are using newer than browser 4 now. 8)

| 3) Same question about this code:
|
| > </div><!-- /wrapper -->
| > </body>

This is just a comment so that you can keep track of the end of the wrapper.
You might want to add another <div> below and this is not always at the
bottom of the page.
Now you know why relative position?


| I'm no expert, but I have a more-than-basic understanding of CSS and HTML.
I
| can't quite figure out the purpose behind this code. If you could explain
| the concept behind this code, I'd appreciate it. The more I learn, the
| happier I am :>)

I don't think I know all that much.

| --
| Viken K.
| http://www.vikenk.com
|
|
 
V

Viken Karaguesian

See below :>)
| I don't understand this code :>( If you could expand on this a bit, I
| would appreciate it. Some points of interest for me:
|
| 1) Why position:relative? Wouldn't it be enough to just set the width
and
| right/left margin to auto?

A relatively positioned page element is *not* removed from t­he flow of
the
code on the page, so it will use thespot where it would have­ appeared
based
on its position in the code as its zero point reference. If­ you then
supply
top, right, bottom, or left positions to the style for this ­element,
those
values will be used as offsets from its zero point.

I understand the concept of Relative vs. Absolute positioning - my question
was: why use position:relative *at all*? Why not just use:

#wrapper {
text-align: left;
width: 740px;
margin: 0 auto;
}

The OP originally said he wanted to put all images and text inside a layer
(div). So, this is a situation where I would normally not think of using
position:relative or position:absolute. Since he's putting all the text and
images in the div, then the div would be the first line of code and not need
any positioning. It does not matter if it's removed from the flow or not
since, in this case, it's being used as the main container. Of course, I
haven't seen his site to know for sure. The way he describes it makes it
seem like the main container and, therefore, first block of code.

Since I wouldn't have thought of using position:relative, I thought you may
have used it for another reason that was not so obvious for me - a hidden or
little-known benefit, perhaps.

| 2) Why is this code (below) placed inside a comment? Are you trying to
hide
| it from another browser?
---snip---

Just an old style block that I have in FrontPage code snipets...
And yes it was to hide it from older browsers that couldn't handle CSS.

OK. Just wondering :>)

I need to update that - - Most are using newer than browser 4 now. 8)

| 3) Same question about this code:
|
| > </div><!-- /wrapper -->
| > </body>

This is just a comment so that you can keep track of the end of the
wrapper.

I should have realized that. :>0 I usually use <!-- Close Wrap Div -->
 
T

Tom

The page I copied that from has a <h1> before the wrapper and a footer after
that expand the full width of the viewport.
What you have is ok too that makes it Static.
#wrapper {
text-align: left;
width: 740px;
margin: 0 auto;
}

Note:
An element with a static position *cannot* have values for offset­s (top,
right, left, bottom) or if it has them, they will be ignored. Unless
explicitly positioned, all div elements default to static positioning.

So.... If you want to add offsets... you need relative Positioning.

Tom

| See below :>)
|
| > | I don't understand this code :>( If you could expand on this a bit,
I
| > | would appreciate it. Some points of interest for me:
| > |
| > | 1) Why position:relative? Wouldn't it be enough to just set the width
| > and
| > | right/left margin to auto?
| >
| > A relatively positioned page element is *not* removed from t­he flow of
| > the
| > code on the page, so it will use thespot where it would have­ appeared
| > based
| > on its position in the code as its zero point reference. If­ you then
| > supply
| > top, right, bottom, or left positions to the style for this ­element,
| > those
| > values will be used as offsets from its zero point.
|
| I understand the concept of Relative vs. Absolute positioning - my
question
| was: why use position:relative *at all*? Why not just use:
|
| #wrapper {
| text-align: left;
| width: 740px;
| margin: 0 auto;
| }
|
| The OP originally said he wanted to put all images and text inside a layer
| (div). So, this is a situation where I would normally not think of using
| position:relative or position:absolute. Since he's putting all the text
and
| images in the div, then the div would be the first line of code and not
need
| any positioning. It does not matter if it's removed from the flow or not
| since, in this case, it's being used as the main container. Of course, I
| haven't seen his site to know for sure. The way he describes it makes it
| seem like the main container and, therefore, first block of code.
|
| Since I wouldn't have thought of using position:relative, I thought you
may
| have used it for another reason that was not so obvious for me - a hidden
or
| little-known benefit, perhaps.
|
|
| > | 2) Why is this code (below) placed inside a comment? Are you trying to
| > hide
| > | it from another browser?
| > ---snip---
| >
| > Just an old style block that I have in FrontPage code snipets...
| > And yes it was to hide it from older browsers that couldn't handle CSS.
|
| OK. Just wondering :>)
|
|
| >
| > I need to update that - - Most are using newer than browser 4 now. 8)
| >
| > | 3) Same question about this code:
| > |
| > | > </div><!-- /wrapper -->
| > | > </body>
| >
| > This is just a comment so that you can keep track of the end of the
| > wrapper.
|
| I should have realized that. :>0 I usually use <!-- Close Wrap Div -->
|
| --
| Viken K.
| http://www.vikenk.com
|
|
 
G

Guest

When inserting padding in the text part of a page how do you block it from
padding your banner and nav site that is sitting on top? Thanks for the help.
 
T

Tom

Without seeing the page it is hard to say.
But padding can be applied to the area containing the text by putting it in
a <div> of it's own.
<div id="content">your stuff here</div>
Then add to the CSS

#content {
padding: 5px; /* Adjust as needed */
} /* add other stuff as needed */

Like
text-align: left;
font-family: "Times New Roman", Arial, Verdana, sans-serif;
color: #000000;

And a host of others....
CSS is a powerful tool and the more you can learn the easier all of this
will become.

Here's a tutorial on using CSS in FrontPage:
http://www.uwec.edu/help/Fpage00/css.htm
You can find some more links here:
http://www.spiderwebwoman.com/resources/
(Scroll down to CSS Resources).

Tom
| When inserting padding in the text part of a page how do you block it from
| padding your banner and nav site that is sitting on top? Thanks for the
help.
|
| "larman" wrote:
|
| > I am building a webpage where I decided to put all text and images
within a
| > layer. I am creating a webpage very similiar to caffezingaro.com. I am
pretty
| > new at this and truly trying to learn code instead of just building from
the
| > split screen. My idea is to isolate the paragraph and pics in the layer
and
| > center everything for ease of reading on all browsers and I have
centered the
| > header and top banner pic. The <p> color is also different then the page
| > color which again is similiar to the zingaro page. Any help would be
greatly
| > appreciated. I am learning this pretty quickly but my only drawback has
been
| > the whole lining up process. Thanks all.
| >
| > Larry
 
T

Tom

BTW: As you fill a glass of water it reaches the top.
So will the page fill to the bottom....
I forgot to mention that

Tom
| Without seeing the page it is hard to say.
| But padding can be applied to the area containing the text by putting it
in
| a <div> of it's own.
| <div id="content">your stuff here</div>
| Then add to the CSS
|
| #content {
| padding: 5px; /* Adjust as needed */
| } /* add other stuff as needed */
|
| Like
| text-align: left;
| font-family: "Times New Roman", Arial, Verdana, sans-serif;
| color: #000000;
|
| And a host of others....
| CSS is a powerful tool and the more you can learn the easier all of this
| will become.
|
| Here's a tutorial on using CSS in FrontPage:
| http://www.uwec.edu/help/Fpage00/css.htm
| You can find some more links here:
| http://www.spiderwebwoman.com/resources/
| (Scroll down to CSS Resources).
|
| Tom
| || When inserting padding in the text part of a page how do you block it
from
|| padding your banner and nav site that is sitting on top? Thanks for the
| help.
||
|| "larman" wrote:
||
|| > I am building a webpage where I decided to put all text and images
| within a
|| > layer. I am creating a webpage very similiar to caffezingaro.com. I am
| pretty
|| > new at this and truly trying to learn code instead of just building
from
| the
|| > split screen. My idea is to isolate the paragraph and pics in the layer
| and
|| > center everything for ease of reading on all browsers and I have
| centered the
|| > header and top banner pic. The <p> color is also different then the
page
|| > color which again is similiar to the zingaro page. Any help would be
| greatly
|| > appreciated. I am learning this pretty quickly but my only drawback has
| been
|| > the whole lining up process. Thanks all.
|| >
|| > Larry
|
|
 
G

Guest

Again thank you so much for all your help. All you have sebt me has worked
perfect. A couple weird things I noticed is in firefox the center does not
go all the way to the top or bottom. Although I know there are differences in
browsers I probably can do something to correct it.

Also is there something that can be done to make sure when someone sees your
webpage that the font you code on the pages is what they see? I noticed in
trial it defaults to the font set on the browser.

Again your help is so appreciated. I actually have built quite a few
webpages but know I am going back and doing them the RIGHT way by learning
CSS.
 
R

Ronx

Making the #wrapper a relatively positioned container has the
additional benefit that all absolutely positioned layers inside the
#wrapper will take their zero point from wherever the top-left corner
of the #wrapper is, rather than the top-left of the browser viewport.
Thus absolutely positioned elements will correctly move with the rest
of the page content as the viewport is expanded/contracted (subject to
other conditions being met.)
 
R

Ronx

A couple weird things I noticed is in firefox the center does not
go all the way to the top or bottom. Although I know there are
differences in
browsers I probably can do something to correct it.

If you have used Tom's #wrapper method, it works perfectly in all
modern browsers (and NN4). There is probably an error on the page, or
something at the bottom that is outside the #wrapper div. URL?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top