Solved

centering webpage

Posted on 2011-09-18
22
245 Views
Last Modified: 2012-05-12
A client is having problems getting part of their webpage to center in Firefox and IE9. The domain is www.kloomis.com - The top section is on the left and the body is centered. They want the whole page centered. Could you look at the code and see what's beeing missed. I believe it was designed using frontpage.
0
Comment
Question by:cnmgt
  • 9
  • 7
  • 4
  • +2
22 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36558203
you have given margin-left for below div a 241px, but not for table above (which is the header)

please give the margin-left:241px for table as well.

table
{
  margin-left:241px;
}
0
 

Author Comment

by:cnmgt
ID: 36558216
I don't see it in the div tag, what line is it on? Is this what it should look like.

<table
{
  margin-left:241px;
} width="780" height="25" cellspacing="0" cellpadding="0">
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 36558217
You have two <body> tags, the second one should be moved up to replace the first one.   Then <div id="mainbody" style="width: 780px"> should be moved up to right after the <body> tag.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 40

Expert Comment

by:gurvinder372
ID: 36558223
i mean add that style to the css.
table
{
  margin-left:241px;
}

looks like you have never touched css and html before...lolz
0
 

Author Comment

by:cnmgt
ID: 36558227
Please tell me what line numbe the body tags are on. I only see one at line 99
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36558230
or you can even update the line number 103 as

<table width="780" height="25" cellspacing="0" cellpadding="0" style="margin-left:241px">
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36558231
Line 99 and 101.  The one at 101 needs to move up and replace the one at 99.  Yes, all of this is a body tag with attributes and javascript added:

<body style="text-align:center;" onload="FP_preloadImgs(/*url*/'original%20html/psd/index-b/banner03.gif', /*url*/'original%20html/psd/index-b/banner04.gif', /*url*/'original%20html/psd/index-b/banner05.gif', /*url*/'original%20html/psd/index-b/banner06.gif', /*url*/'original%20html/psd/index-b/banner07.gif', /*url*/'original%20html/psd/index-b/banner08.gif')">
0
 

Author Comment

by:cnmgt
ID: 36558235
Gurvinder I added that text to the index page and in IE8 it's on teh right and IE9 & Firefox it's on the left
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36558237
let me have a look at the link itself here. Have you updated the code there also?
0
 
LVL 1

Expert Comment

by:aswinandaswin
ID: 36558239
Hi i checked the HTML source and css thoroughly. All you need is to modify two css class which makes the magic.

body{
      padding:0; margin:0; background:#8F9370;
      margin-left:242Px;
      }
#mainbody{
      width:823px; background:#D5D8BB;
}
0
 

Author Comment

by:cnmgt
ID: 36558240
0
 

Author Comment

by:cnmgt
ID: 36558242
I'll try Dave
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36558244
I don't see margin-left style updated for table there. did you tried my suggestion #36558230?
0
 

Author Comment

by:cnmgt
ID: 36558251
I put it back, try now. Also Dave moving 101 to 99 didn't work
0
 

Author Comment

by:cnmgt
ID: 36558288
any ideas?
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36558295
Okay, it comes on IE8 and chrome too, but not on FF
instead try this

<table width="780" height="25" cellspacing="0" cellpadding="0" style="position:absolute;left:241px">

0
 

Expert Comment

by:savsoft
ID: 36558313
just give margin-left in style then it will work fine......
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36558321
<<just give margin-left in style then it will work fine......>>
@savsoft: I have suggested that already in #36558230, but it didn't work for FF.

0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36558466
The overall div needed to be moved so that all of the elements would move together when the page is resized.  Putting the left-margin on one element causes it to not reposition with the rest when the page is resized.  An edited version is attached.  @cnmgt, try this version.
Kurtis-Loomis.html
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36558472
One other thing, putting the "Revisit-After" is ignored by Google and the other search engines.  They get around to you on their schedule which isn't nearly so often.  If your content never changes, then they will only look at your site every few months.
0
 

Author Comment

by:cnmgt
ID: 36569732
I'll try the changes above shortly. As of right now it appears to align right if the screen is maximized, but it's offset if the screen is minimized.
0
 

Author Comment

by:cnmgt
ID: 36571340
I've made the changes and I'm testing now.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question