Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Div Placements Differ In IE6 & Firefox
Old 08-18-2007, 12:00 AM Div Placements Differ In IE6 & Firefox
Experienced Talker

Posts: 30
Trades: 0
Problem: Div placement is different in IE6 than in Firefox 2.0.0.6. (Don't have IE7 - am assuming it works like 6 or FF - so if it's fixed for them, 7 won't be an issue.)

Test is at: www.dvmvac.com/REDESIGNnew/test.html and
CSS is: DVMcss.css but specific 'rules' are internal to test.html.

As you can see, when a div is used, the 'box' is placed at the left in FF (which I think is correct), but is centered in IE6.

After many many tries, couldn't figure out how to fix it so made the two paragraphs into two <p>'s - one with a top border and the other with a bottom border (I know, I know ... not good practice - especially for extensibility -- but it works).

Does anyone know how to fix the div problem (so I can drop the top/bot <p>'s)?
html911rap is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-18-2007, 01:28 AM Re: Div Placements Differ In IE6 & Firefox
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
If you're talking the top box, you're missing an opening <p> tag in it.

The bottom box is centered in both FF and IE7.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-18-2007, 10:57 AM Re: Div Placements Differ In IE6 & Firefox
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
The reason the div wouldn't center in FF (or IE7), is because you used text-align: center - which works fine for IE 6, but in FF and IE 7 (and other standards-compliant browsers) it will NOT, all it does is center align what's INSIDE the div.

To center a div for any browser but IE 6, you need to add margin: 0 auto; to the rules for the div you wish to center.

So in order to center a div for all browsers, you need both the text-align:center and the margin: 0 auto;

The zero indicates top and bottom margin so you can change that as needed. The "auto" indicates right and left margins and you have to have a defined width on the box/element you want centered.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Div Placements Differ In IE6 & Firefox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11500 seconds with 12 queries