Center page in DREAMWEAVER/HTML

How can I center my page in dreamweaver/HTML??? The image is 1024x768, which is the res I am using nowā€¦ so why do scrollbars appear, and I have to manually scroll to center the page/image?? it doesnā€™t make senseā€¦ ne ideas???

keep in mind you have navigation bars at the top of your browser, so you donā€™t have a full 1024x768ā€¦about 150 pixels lessā€¦

Also, keep in mind your visitorsā€¦ over 60% of sites visited on the web are visited with 800x600 resā€¦ Itā€™s up to you to decide whether to ignore these peopleā€¦

I personally recommend 750x450 maximumā€¦

Rev:elderly:

Ok thanxā€¦ yeh, my actual main content is 600x400 (a flash mvoie), but I had like a border as an image, which, if I donā€™t save it at full size, it tilesā€¦ Neway to stop it from tiling? In that way, It could be a lot smallerā€¦

Use a single cell table, then center the flash movie both vert and horizā€¦ then use the border image as a cell bgā€¦

Maybe that will work?

Rev:elderly:

hmmmmā€¦ can u put a flash movie in a table??? It doesnt seem willing to let me do thatā€¦

I canā€™t understand why I canā€™t just use 2layers.

Do u know of ne way to stop an image from tiling???

yes, simply embed the flash movie in the cell( almost all Flash only sites use a table of some kind to center the movie in the browser)ā€¦ :-\

there is no way to keep the bg image from tiling, except to make it big enough not to show.

The way I spoke of before is the way to ensure the bg image is only in the area of the flash movieā€¦

Rev:elderly:

I seeā€¦ As u can tell from my absence, I hav been trying, but still no luckā€¦ Iā€™ve embedded the swf in a table, but now how do I VERTICALLY center itā€¦???


<table width="100%" height="100%">
<tr>
<td width="100%" height="100%" align="center" valign="middle">

//EMBED CODE HERE

</td>
</tr>
</table>

If you want to use a background image on your page with no repeating just add this between the head tags on your pageā€¦


<STYLE TYPE="text/css">
<--
body {background-repeat: no-repeat; background-image: url(background.gif); }
-->
</STYLE>

If you want to do that on a table just use the word ā€œtdā€ in place of body on the script.

lostinbeta, does that work in both browsers?

I rarely use css, becuase of the cross-browser issuesā€¦

Rev:elderly:

Ermā€¦ I am pretty sure it doesā€¦ I guess I should check that.

But again, I am pretty sure it does.

Thnax for the help Reverend and LostInBetaā€¦ I managed to get evrything centred and matching. I didnt need to use the CSS in the end, just was a case of getting the table to do exactly what I wanted it to do. Ur advice worked reverendā€¦ I put the swf into a cell, and used the cell background for the ā€œbehindā€ image.

Cheers guys:)

Glad it helpedā€¦

:stuck_out_tongue:

Rev:elderly:

I am glad you got it to work as wellā€¦

Rev: I just tested the CSS in Netscape and it works like a charm :slight_smile:

This is the code I usedā€¦

<STYLE TYPE="text/css">
<!--
BODY { background-attachment: fixed; background-image: url(image.gif); }
-->
</STYLE>

thanks lostinbeta, Iā€™ll have to put that in my ā€œbag oā€™ trixā€ :rambo:

Rev:elderly:

Haha, if only I could post all my CSS knowledge here :stuck_out_tongue:

Then you could add all of it into your bag oā€™ tricks :beam:

And as far as I know, all my tricks do work in both browsers.

I have used them in previous versions of my site, and all previous versions of my site (with exception of current version) have been NS and IE compatible.

Oh yeah, and the background-attachment: fixed sicks your background image in place, so if you have to scroll, the background image wonā€™t scroll with it. It will just stay there.

Yeah, that would be cool, I essentially stopped coding HTML about the time CSS came outā€¦ :evil: I just got lazyā€¦plus I havenā€™t had any clients which require itā€¦:stuck_out_tongue:

But it is a great tool, as long as it worksā€¦ :x

Rev:elderly:

I love CSSā€¦ it makes things so much easier, shorter to code and makes a page less cluttered with code.

And it saves a lot on loading times if you find yourself using a lot of un neccessary tags that can easily be done in CSS.