17 replies [Last post]
babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

i am a virtual newbie to css

i have read here for a while and i know that because i have used absolute positioning, things are not going as planned

i am desperate - how can i get my site to center in IE?

it is working fine in FireFox and in Opera

please help! do i really have to redesign the whole thing?

this is the site - nearing completion:

http://www.organicmarket.com.au/home.html

the code I have added to the pages is as follows:

immediately after the <body> tag:

<div id="wrap">

and the immediately before the </body> tag:

</div><!—wrap -->

and then in my style sheet i have:

}

#wrap{
position:relative;
width:850px;
margin-left:auto;
margin-right:auto;
}

is there some way of fixing it from where it stands?

thanks

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

Your problems in IE are caused by the fact you don't have a doctype.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

oh...

thankyou - do you think this will fix it?

how do i know which one to use?

sorry :oops:

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

Yes, it'll fix it for IE6 because without a doctype, IE6 is in quirks mode (rather than standards mode) and behaves like an IE5+ browser.
To fix the problem for IE5+ browsers, you need to add text-align: center to the containing element (you may then need to reset the text-alignment on other elements).
As for doctype, if you're serious about creating well-formed, standards compliant pages, you'll choose a strict doctype. I use this one:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

(The <html xmlns... line replaces <html>.)

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

oh! yes it does work, but the text does not recognise the overflow command now - is that because of the following?

>>>To fix the problem for IE5+ browsers, you need to add text-align: center to the containing element<<<

do you mean the wrap element in the style sheet, or on the page itself?

sorry!

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

Not quite sure what you mean, but yes, I was talking about applying text-align: center to whichever element you've got the auto right & left margins on.
Other points about your page: you need to run it through the validator as there are quite a few errors including this one:

div id "left" You're missing the = . Also, you've used the ID left twice - IDs are unique identifiers and can only be used once. Classes are used otherwise.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

Also, you're probably not gonna want to hear this as you're close to finished already, but I find the navigation along the bottom really annoying because I have to scroll down before I can access any of the links.
I'm also getting the cursor turn to a hand as if rolling over a link on various parts of the layout where there aren't any links.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

ok - thanks

will do the validation as soon as i get it working!

the text is still not confined in the area it is supposed to be in...

:oops:

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

>>>I have to scroll down before I can access any of the links.<<<

really?

oh...

i thought about putting it at the top, but the other designer wanted it at the bottom... and it does look better...

most people wouldn't have to scroll would they?

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

babushka wrote:
most people wouldn't have to scroll would they?

Well I'm on 1024 x 780. The only way I see the links is if I have some of my toolbars turned off. Different people are going to have different toolbars turned on, so there's a chance that some people won't be able to see the links. As for people using 800 x 600, they've got no chance.
Have you uploaded the changes you're making so I can see what's going on with the new problem?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

am just loading now...

looks like we'll have to move the menu - thanks...

bugger - this is turning into a real mess...

Sad

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

in IE, it is completely ignoring the fact that I have set a width to the text area

and in FF is has moved the width and hieght of the text area to way outside of where they are meant to be...

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

width: 475;
height: 295;

You're missing the unit, ie px. I really should've pointed you in the direction of the forum rules first because points 3 & 4 say that you must have a valid DTD and have validated your CSS & HTML. Validation would've answered these problems for you.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

oh...

i am so sorry...

i feel bad enough!

where do i validate please?

thankyou so much for all you help

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

babushka
Offline
Regular
South Australia
Last seen: 14 years 34 weeks ago
South Australia
Joined: 2005-12-08
Posts: 13
Points: 0

** please help! - centering across browsers

thanks again for all your help

here it is now

Smile

http://www.organicmarket.com.au/home.html

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 42 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

** please help! - centering across browsers

Yeah, I think that's better. Smile

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference