Solved

div is centered in Dreamweaver but not in browsers...??

Posted on 2012-03-22
6
325 Views
Last Modified: 2012-03-23
Hello,

I am using a method I have used before to center divs.  It shows up as centered in dreamweaver, but not in Safari or Firefox......code snippet below:

<div id="bigwrapperDiv">
<form method="get" action="" class="asholder" id="myForm" name="myForm">
<div id="headerDiv">
  <p><small style="float:left">
    <input   id="thisid"   value="0" style="font-size: 10px; width: 30px;" disabled="disabled" />
    </small><small style="float:left">
      <input type="hidden" id="isTest"   value="" style="font-size: 10px; width: 30px;" disabled="disabled" />
    </small>
    <small style="float:left">
      <input type="hidden" id="currentScore"   value="" style="font-size: 10px; width: 30px;" disabled="disabled" />
    </small><span class="contactinfo"><small style="float:left">
    <input   id="evaluatorid"   value="" style="font-size: 10px; width: 30px;" disabled="disabled" />
    <input   id="searchByWhat"   value="1" style="font-size: 10px; width: 30px;" disabled="disabled" />
    <input   id="currentSelect"   value="" style="font-size: 10px; width: 80px;" disabled="disabled" />
    </small></span><br />
  </p>
  </div>
</form>
<div id="mainContent" class="headerDiv">
  </div>
</div>

Open in new window

and CSS....
#bigwrapperDiv {width: 969px; margin:0 auto;overflow:hidden; padding-top:40px;}
#headerDiv {width:969px;border: 1px solid black;overflow:hidden;}

Open in new window


Thanks in advance for any help!

Cheers!
0
Comment
Question by:cougarsy
  • 3
  • 2
6 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 37753074
First of all, please NEVER use Dreamweaver "design" view to test any type of code. Always use the browser.  

Second: What are you trying to center? The bigwrapperDiv is centered for me.  You've given it a width as well as margin:0 auto which centers it within the browser.

Can you show a screenshot or maybe a live URL of the issue?
0
 

Author Comment

by:cougarsy
ID: 37753291
Hi and thanks for your quick reply.  Here is a link to a page that is not centering correctly:

http://www.infocuseurope.com/Dashboard/CENTERSAMPLE.ASP

The code is a bit of a mess, but it is a sample to show what I am trying to center.

Thanks!

Cheers!
0
 
LVL 30

Assisted Solution

by:LZ1
LZ1 earned 150 total points
ID: 37753306
You have a position:absolute on the body tag

Line 8 on this file: http://www.infocuseurope.com/css/autosuggest_inquisitor.css

Kill that and all will be good
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:cougarsy
ID: 37753330
Thank you so much!  I cannot make the changes now, but will do so in a couple hours and get back to you!!!

Cheers!
0
 
LVL 17

Accepted Solution

by:
nanharbison earned 350 total points
ID: 37753613
You also have several of these: float:left
0
 

Author Closing Comment

by:cougarsy
ID: 37756152
I split the points because LZ1 pointed out valid points that I felt were helpful in implementing best practices for my page.  However, the real 'fix' for me was nanharbison's solution of removing the 'float:left'.

Many thanks to you both!

Cheers!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ust html in ms/access WebBrowswer 11 43
jQuery value within div undefined 3 21
modify h2 4 13
Gradient CSS 4 13
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

757 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

19 Experts available now in Live!

Get 1:1 Help Now