Centering Website in Kompozer

Discuss various technical topics not related to Mozilla.
Post Reply
NJCurmudgeon13
Posts: 6
Joined: May 24th, 2016, 11:51 am

Centering Website in Kompozer

Post by NJCurmudgeon13 »

I posted this to a KompoZer forum over a month ago and got no replies, so I am trying here...

I am new to KompoZer but have been muddling my way through redesigning a website for a client. Currently, I have a homepage that consists of a JPG background and a menu bar.

The JPG is placed into a table. The menu was made using dropdownmenugenerator.com and I copied and pasted the html into a box in KompoZer using the "insert HTML" function. I was able to use layers to move the menu over the JPG and get it into position. The image and the menu are flush-left and when viewed in the browser, it all stays in position regardless of if I zoom the view in or out.

The thing is, however, I would like for the page to be centered across whatever size screen the user is viewing with. I have used Yahoo's SiteBuilder for other sites and it is a one-click operation. I see nothing like that with KompoZer. I know that I can center the JPG inside the table, and that does the trick. However, the menu bar position is independent, so when viewed in other browsers or monitors, it is out of position against the background. When I zoom in and out, they move independently.

I am aware of CSS codes that can be used, but none of the tutorials make sense with what I have. I have also tried inserting the JPG alone, not inside of a table, and I can't seem to get that centered at all.

I am somewhat new to a lot of this, so I would greatly appreciate some guidance how to get this accomplished. Thank you!

Gordon
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Centering Website in Kompozer

Post by Frenzie »

Nobody will be able to say anything sensible without sufficient sample code. :)
Intelligent alien life does exist, otherwise they would have contacted us.
NJCurmudgeon13
Posts: 6
Joined: May 24th, 2016, 11:51 am

Re: Centering Website in Kompozer

Post by NJCurmudgeon13 »

Here ya go!

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Index</title>
</head>
<body
style="color: rgb(0, 0, 0); background-color: rgb(236, 232, 220);"
alink="#000099" link="#000099" vlink="#990099">
<table style="text-align: left; width: 100%;" border="0"
cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="text-align: justify;"><img
style="width: 1024px; height: 768px;" alt=""
src="Images/Home.jpg"></td>
</tr>
</tbody>
</table>
<br>
<br>
<div style="position: absolute; top: 91px; left: 328px;">
<table style="text-align: left; width: 100%;" border="0"
cellpadding="20" cellspacing="2">
<tbody>
<tr>
<th>
<script type="text/javascript"
src="http://Menu16.com/U/10714CCA/2/MyMenu2.js"></script>
<div id="MyMenu2"></div>
</th>
</tr>
</tbody>
</table>
</div>
<br>
</body>
</html>
User avatar
Grumpus
Posts: 13232
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Centering Website in Kompozer

Post by Grumpus »

You could try putting your page into the W3C Validator and see any errors or what is missing.
W3C Validator
There's three different input tabs and I would advise using verbose and letting the errors and warning fall in order instead of bunching them together.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
NJCurmudgeon13
Posts: 6
Joined: May 24th, 2016, 11:51 am

Re: Centering Website in Kompozer

Post by NJCurmudgeon13 »

That would be a useful tool in general, but I'm not sure how I would use it to solve the issue of getting the page to center? I am guessing there is some CSS code or something I should be inserting to get it to center. I'm just not knowledgeable enough about this stuff to know what and where...
User avatar
Grumpus
Posts: 13232
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Centering Website in Kompozer

Post by Grumpus »

It might give you a start but you might also use the tools in the /Tools/Web Developer and look at some of the makeup of the page.
html should set the position parameters.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Centering Website in Kompozer

Post by Frenzie »

So if I understand correctly you want a centered background picture? Then just use CSS to stick it on the HTML or BODY element, see https://developer.mozilla.org/en-US/doc ... d-position

Code: Select all

<style>
html{
background-image: url(http://etc);
background-repeat: no-repeat;
background-position: top center;
}
</style>
Or something along those lines.
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
Frank Lion
Posts: 21172
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Centering Website in Kompozer

Post by Frank Lion »

NJCurmudgeon13 wrote:The thing is, however, I would like for the page to be centered across whatever size screen the user is viewing with. I have used Yahoo's SiteBuilder for other sites and it is a one-click operation. I see nothing like that with KompoZer. I know that I can center the JPG inside the table, and that does the trick. However, the menu bar position is independent, so when viewed in other browsers or monitors, it is out of position against the background. When I zoom in and out, they move independently.
Well, they would be out of position, wouldn't they?

You've centred the image, left justified the menu and are then surprised that they don't move together into position on resize?

You don't need to use css, but you do need to make up your mind what you want. I did the above with SeaMonkey's Composer instead of my usual Komposer in 20 seconds - and it's just insert image, hit 'Align Text Centred' button on it and repeat for the menu code, centre it the same way and it's done. Always centred, no matter what size the user's screen is.

You can then just hit the Source tab at the bottom to see what the css code then looks like.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
NJCurmudgeon13
Posts: 6
Joined: May 24th, 2016, 11:51 am

Re: Centering Website in Kompozer

Post by NJCurmudgeon13 »

I will check out SeaMonkey Composer. I am used to SiteBuilder because my sites have been through Yahoo (now Aabaco), but the people I am doing this for are using another hosting company, so SiteBuilder won't work for them. I was trying to find an open source software for them to use to make updates once the revamped site is done. I had looked at a couple and ended up with KompoZer. Fortunately, we are not all that far into the project so swapping for a different program is still easy.

Thanks.
User avatar
Frank Lion
Posts: 21172
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Centering Website in Kompozer

Post by Frank Lion »

NJCurmudgeon13 wrote: I was trying to find an open source software for them to use to make updates once the revamped site is done. I had looked at a couple and ended up with KompoZer.
You should stick to it, it's good. The point I was making was that any WYSWIYG html editor will do what you want above, just by pressing existing buttons.

This stuff is never worded very well, but the 'Align Text Centred' button also centres images, etc.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
Grumpus
Posts: 13232
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: Centering Website in Kompozer

Post by Grumpus »

Something I found was if the image is locked to a line or paragraph in some text editors and there's a preceding tab in the line this can also skew the position of the image.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
Post Reply