View Full Version : center page in DREAMWEAVER/HTML
Pjc4real
October 30th, 2002, 12:11 PM
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???
reverendflash
October 30th, 2002, 12:20 PM
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:
Pjc4real
October 30th, 2002, 12:22 PM
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....
reverendflash
October 30th, 2002, 12:25 PM
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:
Pjc4real
October 30th, 2002, 12:32 PM
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???
reverendflash
October 30th, 2002, 12:36 PM
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:
Pjc4real
October 30th, 2002, 01:48 PM
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......????
lostinbeta
October 30th, 2002, 02:07 PM
<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.
reverendflash
October 30th, 2002, 02:29 PM
lostinbeta, does that work in both browsers?
I rarely use css, becuase of the cross-browser issues...
Rev:elderly:
lostinbeta
October 30th, 2002, 02:31 PM
Erm... I am pretty sure it does... I guess I should check that.
But again, I am pretty sure it does.
Pjc4real
October 30th, 2002, 02:34 PM
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:)
reverendflash
October 30th, 2002, 02:36 PM
Glad it helped...
:P
Rev:elderly:
lostinbeta
October 30th, 2002, 02:46 PM
I am glad you got it to work as well....
Rev: I just tested the CSS in Netscape and it works like a charm :)
This is the code I used....
<STYLE TYPE="text/css">
<!--
BODY { background-attachment: fixed; background-image: url(image.gif); }
-->
</STYLE>
reverendflash
October 30th, 2002, 02:48 PM
thanks lostinbeta, I'll have to put that in my "bag o' trix" :rambo:
Rev:elderly:
lostinbeta
October 30th, 2002, 02:50 PM
Haha, if only I could post all my CSS knowledge here :P
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.
reverendflash
October 30th, 2002, 02:52 PM
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...:P
But it is a great tool, as long as it works... :x
Rev:elderly:
lostinbeta
October 30th, 2002, 02:58 PM
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.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.