Our Forum has Moved

This site is our old forum and is only here for achive until we get proper 301 redirects setup to make Google happy.

Please use our new community site - Our Umbraco - which contains an improved forum, documentation wiki, package repository and a member locator.

Go to Our Umbraco now

Learn everything about Umbraco
Center website in Internet Explorer 7 Options
trfletch
Posted: Tuesday, February 17, 2009 1:02:06 PM
Rank: Aficionado

Joined: 2/16/2009
Posts: 117
Location: England
Hi,

I have created a website in Umbraco 4 that is centered perfectly in Firefox, Safari and Google Chrome by using the following style:

#container {
width: 901px;
margin-left: auto;
margin-right: auto;

The problem is this doesn't work in Internet Explorer 7, I know that if I use:

#body {text-align:center;}
#container {text-align:left;}

then my page displays in the center of Internet Explorer correctly but the problem with this is in the Umbraco text editor all the content appears centered which will be confusing for the end user when they are modifying the pages. Does anyone have a solution to get round this? Many thanks Tony

Regards
Tony
ascendinternet
Posted: Tuesday, February 17, 2009 1:06:56 PM

Rank: Fanatic

Joined: 11/16/2007
Posts: 264
Location: Surrey, UK
Generally, I have one stylesheet for layout and (at least) one for presentation.

Assign the presentation one to the Rich Text Editor in Umbraco to get the font, etc, styling without the layout stuff.

Gordon Saxby | Ascend Internet Limited | Web Site Development. Web Site Hosting (inc Umbraco)
trfletch
Posted: Tuesday, February 17, 2009 2:15:22 PM
Rank: Aficionado

Joined: 2/16/2009
Posts: 117
Location: England
Thank you for your response, I think I have managed to solve the issue using your solution, now all I have to do is work out why the menu isn't the same width in Internet Explorer!!! d'oh!

Regards
Tony
Petr Snobelt
Posted: Tuesday, February 17, 2009 4:24:35 PM
Rank: Fanatic

Joined: 10/2/2007
Posts: 315
Location: Czech Republic
It looks like you are in quirks mode, so box model is corrupted in IE.
Try look here http://www.quirksmode.org/css/box.html
trfletch
Posted: Tuesday, February 17, 2009 6:06:24 PM
Rank: Aficionado

Joined: 2/16/2009
Posts: 117
Location: England
Thank you for your response. from what I understand from reading that article that problem is with IE5, is that correct? I did try adding "box-sizing: border-box" to my body style anyway but it didn't make any difference, am I doing something wrong?

Regards
Tony
Petr Snobelt
Posted: Wednesday, February 18, 2009 1:32:07 PM
Rank: Fanatic

Joined: 10/2/2007
Posts: 315
Location: Czech Republic
Hi,
box model cause problems in all versions of IE, newer versions too if it is in quirks mode, which depend on doctype declaration.
try google or http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug

Petr
trfletch
Posted: Thursday, February 19, 2009 11:47:04 AM
Rank: Aficionado

Joined: 2/16/2009
Posts: 117
Location: England
Thank you for your reply, I looked at the wikipedia site which helped me realise that my page was missing:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Once I added that code into my master template it renders correctly. Thanks again for your help.

Regards
Tony
Petr Snobelt
Posted: Thursday, February 19, 2009 1:57:48 PM
Rank: Fanatic

Joined: 10/2/2007
Posts: 315
Location: Czech Republic
I'm glad you know something new about our 'lovely' IE :-)
Hannibal99
Posted: Wednesday, July 08, 2009 7:19:30 AM
Rank: Newbie

Joined: 6/6/2009
Posts: 1
Location: El Salvador
That worked for me also! I had the same problem and thought it was a problem with the hosting since locally it worked fine. Keep it up with the good work!

The forum has moved

This forum is no longer in use, so you can't reply to this message - please go to Our Umbraco

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.