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
Website Center Troubles (In IE)
Old 05-26-2006, 09:32 PM Website Center Troubles (In IE)
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
Ok so I thought I had this issue fixed, but when I load my website in IE it does not center the page like it does in FF. I was wondering if it is my CSS code or what.

Link to site: http://silent.2dollarhost.net

CSS for centering
Code:
div#rel {position:relative; width:678px; height:500px; margin:1px auto; background:#FFFFFF}
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 05-27-2006, 07:23 AM Re: Website Center Troubles (In IE)
xplicit's Avatar
Average Talker

Posts: 23
Location: http://xplicit.godzsite.com
Trades: 0
looks fine in both of mine ?
__________________

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

The Future Is Bright, The Future is 0penSource.
Free cPanel Php And mySql - No ADS!
xplicit is offline
Reply With Quote
View Public Profile Visit xplicit's homepage!
 
Old 05-27-2006, 10:06 AM Re: Website Center Troubles (In IE)
Skilled Talker

Posts: 85
Trades: 0
For IE add this to your CSS:

body { text-align: center; }
div { text-align: left; }
danielefc is offline
Reply With Quote
View Public Profile
 
Old 05-27-2006, 01:24 PM Re: Website Center Troubles (In IE)
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
It is not centered in IE 6, but is in FF.. no big surprise there.

First of all, put in a DOCTYPE - at LEAST HTML 4.01 Strict or XHTML 1.0 Transitional.

Second, looks like you've got just about everything absolutely positioned. Why ?
If you're going to use CSS, there is no need for font tags.

Validate your CSS.. you have errors. Your HTML doesn't validate either, but without a DOCTYPE it won't validate properly anyway.
__________________
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 05-27-2006, 04:37 PM Re: Website Center Troubles (In IE)
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
Danielefc - That just center the text not the images.

LadynRed - it is absolute position because I use a program to cut down on coding time and thats what it saves it as. As far as validation... how will that help me at all if i don't know what code to insert...
__________________
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 05-27-2006, 07:15 PM Re: Website Center Troubles (In IE)
AliKat's Avatar
Extreme Talker

Latest Blog Post:
Save the Children
Posts: 176
Location: MS
Trades: 0
margin: auto does not work in IE. In order to center anything on your page your body has to have text-align: center; and your container tag needs text-align: left; to over-write the centering of the text. If you have everyting absolutately position then this technique may not work. There is a way to absolutely position and center at the same time using margin: -(half the width of your element)
AliKat is offline
Reply With Quote
View Public Profile Visit AliKat's homepage!
 
Old 05-27-2006, 08:29 PM Re: Website Center Troubles (In IE)
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
AliKat - "There is a way to absolutely position and center at the same time using margin: -(half the width of your element)" So how would I do this?
__________________
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 05-28-2006, 09:14 AM Re: Website Center Troubles (In IE)
AliKat's Avatar
Extreme Talker

Latest Blog Post:
Save the Children
Posts: 176
Location: MS
Trades: 0
An Example:

HTML Code:
#page {
 position: absolute;
 left: 50%;
 width: 700px;
 margin-left: -350px;
}
I beleive that is all you need. I'm doing this from memory and didn't test the code out. I read it on someone's blog and I didn't book mark the resource.
AliKat is offline
Reply With Quote
View Public Profile Visit AliKat's homepage!
 
Old 05-28-2006, 12:16 PM Re: Website Center Troubles (In IE)
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
I suspect you've used Dreamweaver to convert a table-based layout to CSS. Is that the case ?? I'm familiar with DW's nasty coding in that scenario by making EVERYTHING absolutely positioned -- horrible.

Absolutely positioning everything opens up it's own can of worms, not the least of which is the lack of flow in the document. Learn to code HTML and CSS correctly and you won't need to absolutely position every single thing.

My usual method for centering a layout :
<body>
#container - text-align: center - no fixed width it's JUST a container
#wrapper - fixed width, position: relative, margin: 0 auto;

that structure makes IE center with the text-align and centers in all standards-complaint browers using the margin: 0 auto;.

The rest of your content you put into your #wrapper in the order in which you want it to appear on the page. Absolute positioning is NOT necessary in most cases.
__________________
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 05-28-2006, 03:45 PM Re: Website Center Troubles (In IE)
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
AliKat - When the browser isnt set to full view it cuts off the left side.

LadynRed - ...that didnt work at all it cut a lot off
__________________
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 05-28-2006, 05:30 PM Re: Website Center Troubles (In IE)
AliKat's Avatar
Extreme Talker

Latest Blog Post:
Save the Children
Posts: 176
Location: MS
Trades: 0
LadynRed, don't ya need a text-align: left in your #wrapper? otherwise everything is centered inside it?
AliKat is offline
Reply With Quote
View Public Profile Visit AliKat's homepage!
 
Old 05-30-2006, 01:41 PM Re: Website Center Troubles (In IE)
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Yes, AliKat.. you're right.. I forgot to add that.

Silent, I suspect it 'cut a lot of stuff off' because you probably still have everything else absolutely positioned. Source order and document flow are your friends - not your enemy.
__________________
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 05-31-2006, 04:18 PM Re: Website Center Troubles (In IE)
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
I was trying to find a quick fix for this that wouldn't require me to re-code a massive amount of the site.
__________________
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 05-31-2006, 06:17 PM Re: Website Center Troubles (In IE)
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Add the following rules to your css file;
body { text-align: center; }
I would also specify your body background color too in the body section.

Add this to the div#rel rules
text-align: left;
__________________
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


Last edited by LadynRed; 05-31-2006 at 06:18 PM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-31-2006, 07:03 PM Re: Website Center Troubles (In IE)
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
Thanks LadynRed it is now working... as far as I know
__________________
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 Website Center Troubles (In IE)
 

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