Solved

centering webpage

Posted on 2011-09-18
22
219 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 82

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
 
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 82

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 82

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 82

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
while loop in html mail format 5 32
Change month dropdown 5 15
Text in block not displaying properly 2 12
Bootstrap 3 icons 3 9
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now