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
** please help! - centering across browsers
Your problems in IE are caused by the fact you don't have a doctype.
** please help! - centering across browsers
oh...
thankyou - do you think this will fix it?
how do i know which one to use?
sorry :oops:
** 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>.)
** 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!
** 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.
** 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.
** 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:
** 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?
** please help! - centering across browsers
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?
** 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...
** 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...
** 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.
** 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
** please help! - centering across browsers
** please help! - centering across browsers
** please help! - centering across browsers
** please help! - centering across browsers
Yeah, I think that's better.