Centre web page using </head> replacement

D

David Mustard

Hi I have tried to centre my web page using the hack width="760"align="center"><tr><td> I found here on this forum and just cant get it to work I tried various different ways of doing it. I have tried it with < at the begining as without it, it displays the text on the website. I have converted the numbers incase it is because of inches but it doesn't seem to make any difference. Can anyone shed some light. Web page is http://www.thechimneypot.co.nz I have the hack in place just now.


Submitted via EggHeadCafe - Software Developer Portal of Choice
A Memory-Mapped File Cache TCpListener Service
http://www.eggheadcafe.com/tutorial...e0-d39aff2c9bb3/a-memorymapped-file-cach.aspx
 
D

DavidF

I looked at you home page and you cobbled the hack on that page at least.
When you tried to replace </head> you actually deleted it. Look for it under
your source code and it isn't there. It is on your other pages, but the
centering code snippet is not. Also your pages appear to be much wider than
760 pixels...how wide do you have your pages set for in Publisher? The width
you are using right now is way too wide.

Try producing new web pages and editing them, but this time follow the
instructions more carefully. I would also suggest that you do download and
use replaceinfiles to do the edit for you. Once you get it to work correctly
you don't have to worry about these sort of coding mistakes.

But before you worry about centering your pages you need to address the way
you named your other pages. The link to your "AboutUs" page is
http://www.thechimneypot.co.nz/about Note that there is no file extension
and the page will not render in FF at all. All you get is the source code.
Each page of you site should end with the .htm extension. I don't know where
you removed the extension, but you need to upload new files. When you
publish to the web you will get an index.htm file and an index_files folder
where all your other pages and the supporting graphics are. That means links
to the images will be
http://www.thechimneypot.co.nz/index_files/image3921.jpg and the link to
your about us page should be
http://www.thechimneypot.co.nz/index_files/about.htm . You need to rewrite
your links. Delete the old files on your host and publish new.

Also in another post you made earlier you commented about having problems
with ???? showing up. Change your encoding to Unicode (UTF-8) as per my
reply.

You need to get your basic file structure and navigation working correctly
before you worry about centering your pages.

DavidF
 
D

David Mustard

I had not fully finished the site and was aware that it was not rendering in FF this was because the files were not in their directories. Have now got the links under control and site fully functional. I have created seperate directories for each page in order to eliminate the file extensions I find them just a bit messy, all the pages are index.htm files within the seperate directories this enables me to edit the files more effectivly rather than keeping them all together as a publisher website.

Its kind of like having lots of different websites I know, but I use publisher to build individual pages of the site then edit it using notepad as a html editor. The truth is I am tired of publisher and should really move on to something else but have not done anything about it. The replaceinfiles script wont work for this kind of setup I dont think. I have the page size set wider (1366) in order for it to render in the center of my laptop when I view it but it obviously is off to the right when viewed on a 800 x 600 moniter and is too big for the screen this is why I was trying to get the center script to work in order to stop setting it wider, then I could go back to setting it at 760 then it should be viewable in the center of any sized monitor. I have only just discovered there was a script you could use to do this I have been looking at fluid rendering up until now but that doesnt work in publisher seemingly. I am going to build another copy of my home page set at 760 and try the script again although I did try placing the script after the </head> tag, in the tag and all sorts of ways and didnt seem to get any effect, may have been as you say though and I had not coded it correctly or the page was set too wide. If I can get it to work will reset the whole site to 760 wide and will be good.


Than you for the unicode (utf-8) encoding advice I have managed to get both my sites www.thechimneypot.co.nz and www.mustardconstruction.co.nz to render in all the browsers I have tried so far including IE8 by using the .htaccess file I mentioned on the other string without ???? and squares but in future I will use this tip. Much appreciated, as is all your advice.

Regards
David Mustard



DavidF wrote:

I looked at you home page and you cobbled the hack on that page at least.
01-Dec-09

I looked at you home page and you cobbled the hack on that page at least
When you tried to replace </head> you actually deleted it. Look for it unde
your source code and it is not there. It is on your other pages, but th
centering code snippet is not. Also your pages appear to be much wider tha
760 pixels...how wide do you have your pages set for in Publisher? The widt
you are using right now is way too wide

Try producing new web pages and editing them, but this time follow th
instructions more carefully. I would also suggest that you do download an
use replaceinfiles to do the edit for you. Once you get it to work correctl
you do not have to worry about these sort of coding mistakes

But before you worry about centering your pages you need to address the wa
you named your other pages. The link to your "AboutUs" page i
http://www.thechimneypot.co.nz/about Note that there is no file extensio
and the page will not render in FF at all. All you get is the source code
Each page of you site should end with the .htm extension. I do not know wher
you removed the extension, but you need to upload new files. When yo
publish to the web you will get an index.htm file and an index_files folde
where all your other pages and the supporting graphics are. That means link
to the images will b
http://www.thechimneypot.co.nz/index_files/image3921.jpg and the link t
your about us page should b
http://www.thechimneypot.co.nz/index_files/about.htm . You need to rewrit
your links. Delete the old files on your host and publish new

Also in another post you made earlier you commented about having problem
with ???? showing up. Change your encoding to Unicode (UTF-8) as per m
reply

You need to get your basic file structure and navigation working correctl
before you worry about centering your pages.

DavidF


<David Mustard> wrote in message

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
VB.NET Single Sign-On with DIGEST, BASIC, LDAP
http://www.eggheadcafe.com/tutorial...8b4-f362ec5d0af4/vbnet-single-signon-wit.aspx
 
D

David Mustard

fao. Davidf

I have rebuilt a sample page of my site and uploaded it to my server you can view it at (www.thechimneypot.co.nz/front1.htm)
I set the page width in publisher to 760 and inserted the script for making it center and it has worked when I view it on my desktop on a 800 x 600 screen ( I watched it jump over to the center when I refreshed the page) but when I view it on my laptop (which has a 1366 wide screen) it is still on the left hand side.

Any clues????





David Mustard wrote:

file extensions
04-Dec-09

I had not fully finished the site and was aware that it was not rendering in FF this was because the files were not in their directories. Have now got the links under control and site fully functional. I have created seperate directories for each page in order to eliminate the file extensions I find them just a bit messy, all the pages are index.htm files within the seperate directories this enables me to edit the files more effectivly rather than keeping them all together as a publisher website.

Its kind of like having lots of different websites I know, but I use publisher to build individual pages of the site then edit it using notepad as a html editor. The truth is I am tired of publisher and should really move on to something else but have not done anything about it. The replaceinfiles script wont work for this kind of setup I dont think. I have the page size set wider (1366) in order for it to render in the center of my laptop when I view it but it obviously is off to the right when viewed on a 800 x 600 moniter and is too big for the screen this is why I was trying to get the center script to work in order to stop setting it wider, then I could go back to setting it at 760 then it should be viewable in the center of any sized monitor. I have only just discovered there was a script you could use to do this I have been looking at fluid rendering up until now but that doesnt work in publisher seemingly. I am going to build another copy of my home page set at 760 and try the script again although I did try placing the script after the </head> tag, in the tag and all sorts of ways and didnt seem to get any effect, may have been as you say though and I had not coded it correctly or the page was set too wide. If I can get it to work will reset the whole site to 760 wide and will be good.


Than you for the unicode (utf-8) encoding advice I have managed to get both my sites www.thechimneypot.co.nz and www.mustardconstruction.co.nz to render in all the browsers I have tried so far including IE8 by using the .htaccess file I mentioned on the other string without ???? and squares but in future I will use this tip. Much appreciated, as is all your advice.

Regards
David Mustard

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Silverlight 3 Bing API: A Related Links Widget
http://www.eggheadcafe.com/tutorial...8feb-57559fdf27f2/silverlight-3-bing-api.aspx
 
D

DavidF

You did not edit the code correctly.

You replaced </head> with:

<width="760"align="center"><tr><td>

What you should have done is replace </head> with:

</head><table border="0" cellpadding="0" cellspacing="2"
width="760"align="center"><tr><td>

All of this should be on one line in Notepad, though it will wrap here in
the newsgroup.

DavidF
 
R

Rob Giordano [MS MVP]

If you're thinking of moving on to a real html editor you should do it now
before spending more time redesigning your site, because everything you do
in Publisher will not be reusable except for the graphics.



--
~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression Web






in message
 
D

DavidF

One of the limitations of using Publisher to build websites is that as
websites grow larger they become increasingly more difficult to manage. One
of the solutions for that is to build your website using multiple Publisher
files and organizing your site with subfolders or subdirectories. I have
been using this approach myself since I outgrew the 10 page limit of the
navbar in Publisher 2000. There is no problem with this approach as long as
you plan the site structure carefully, use full path hyperlinks and drop the
wizard built navbars which use relative links. There is also another way to
do this as described in this article:

Building a web site with multiple Publisher web publication files:
http://msmvps.com/blogs/dbartosik/pages/81264.aspx

The replaceinfiles script will work for this kind of approach. You just need
to point the script toward the different folders that contains the different
pages...the different index.htm files on your hard drive before you upload
them. At the same time since you are hand editing it would likely be just as
fast to have the centering code in a txt file, then copy and pasting it in
the index.htm files after you open them in Notepad. The replaceinfiles
approach is handy when you have multiple .htm files...you can do them all at
once, but since you will probably be only updating one page at a time, or
one Publisher file at a time, then you don't have to worry about redoing the
other pages.

Ultimately since you are open to hand coding and breaking your site up into
subdirectories you really should consider moving on from Publisher. There
are lots of alternatives. If you want to go MS then consider Web Expression
which replaced FrontPage:

Expression Web free trial available for download from the Expression
Web product site:
http://www.microsoft.com/expression/products/Web_Overview.aspx
You will need to learn html and php coding and though it is in its third
version, it still has it's bugs...read the forum to learn more. It is
intended to produce standards compliant code.

Or perhaps try Sharepoint Designer - a free download from
http://office.microsoft.com/en-us/sharepointdesigner/FX100487631033.aspx
I have been told that you can import Publisher pages into SharePoint and the
coding isn't too messed up. However chances are you should plan on just
recycling your images and your text and start over if you move to a
different program. Publisher code is non-standard and cleaning it up will
probably take longer than just starting over.

If you want a free html editor, some people have recommended:

Reference: Nvu - open-source web authoring program:
http://net2.com/nvu/

And finally if you want the advantages or laying your pages out much as you
do with Publisher you could try Serif WebPlus which has also been
recommended. They have an old version for free, but the newest version is
affordable. It already has a lot of the features that have been on our wish
list for years and never implemented into Publisher such as the option of
centering the pages. It is the direction the MS should have taken Publisher
in my humble opinion. It is my understanding that it produces standards
compliant code and also gives you the option of editing the code directly.
It might be the best choice for you. They have a forum that you might check
out.

http://www.serif.com/webplus/
http://www.freeserifsoftware.com/software/webplus/index.asp

Do get away from the extra wide pages...your content doesn't need them and
you will alienate many people by forcing them to scroll horizontally. Figure
out how to correctly center smaller pages with Publisher, switch to other
software or live with left justified pages which are not a bad choice
either:

Reference: Understanding background padding in a Publisher web (aka white
space):
http://msmvps.com/blogs/dbartosik/archive/2006/01/07/80563.aspx

On a final note you might spend a bit more time planning where you want to
take your website(s) before you jump into other software. By identifying the
scope and goals of you site(s) you should then be better able to choose what
software to build them with. Publisher is fine for relatively small, simple
static, fixed-width sites, but it sounds like you should be using something
else. So with that said, I would suggest you also spend some time reading
the material here:

http://www.webdesignfromscratch.com/articles-and-tutorials.php
and here:
http://www.webpagesthatsuck.com/

Time spent on planning your sites now will save you a lot of time in the
future...good luck.

DavidF
 

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