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
Old 12-07-2006, 03:20 PM Centering troubles
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
I have a table inside of a div that I added this code to
Code:
        body.margin {
            margin:0;
            }
        div.container {
            width: 790px;
            margin-right:auto;
            margin-left:auto;
            text-align:center;
          }
the html is this
HTML Code:
<body class="margin">
<div class="container">
When I add the width on the container it works in IE but doesn't in FF, when I get rid of the width it works in FF but not IE. So does anyone know why this is doing this?

Thanks.
__________________
Firefox
rediscover the web

Please login or register to view this content. Registration is FREE
Down with internet explorer!
Silent77 is offline
Reply With Quote
View Public Profile Visit Silent77's homepage!
 
 
Register now for full access!
Old 12-07-2006, 07:49 PM Re: Centering troubles
blackhawkpowers's Avatar
Ultra Talker

Posts: 313
Name: Dustin
Location: GA
Trades: 0
I have no idea why that is but it may work to do

HTML Code:
<center><div class="container"> ............. </div></center>
</SPAN>

sorta an old way to do it but would work temporarly..
__________________
A patch is a piece of software which replaces old bugs with new bugs.

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
blackhawkpowers is offline
Reply With Quote
View Public Profile Visit blackhawkpowers's homepage!
 
Old 12-07-2006, 07:57 PM Re: Centering troubles
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
Yeah it is a temporary solution but <center> is deprecated
__________________
Firefox
rediscover the web

Please login or register to view this content. Registration is FREE
Down with internet explorer!
Silent77 is offline
Reply With Quote
View Public Profile Visit Silent77's homepage!
 
Old 12-07-2006, 08:12 PM Re: Centering troubles
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Exactly.
You don't need a class for body, just put in rules for body:

body{
margin:0;
padding: 0;
}

As for centering.. you need 2 things:
for IE, put text-align: center in your body rules. Then for FF, Opera, Safari, etc.
put a width on your #container and use the margin: 0 auto; and the container will center. Then add text-align: left to get your TEXT back where it belongs inside the container.
__________________
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
 
Old 12-07-2006, 08:31 PM Re: Centering troubles
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
Ah I see... Thanks
__________________
Firefox
rediscover the web

Please login or register to view this content. Registration is FREE
Down with internet explorer!
Silent77 is offline
Reply With Quote
View Public Profile Visit Silent77's homepage!
 
Reply     « Reply to Centering troubles
 

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.17242 seconds with 12 queries