Click here to get back home

CSS issues with IE - not centering div

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
CSS issues with IE - not centering div Andre-John Mas 11-14-2007
Posted by Andre-John Mas on November 14, 2007, 12:04 pm
Please log in for more thread options
Hi,

I have the following web site:

http://ajmas.dyndns.org/

This displays fine in Safari and Firefox, but in IE I am having the
following issues:
- The 'content' div is not centered
- The 'page_content' div does not fill the width of the parent as it
does in the other browsers

The CSS I am using is at:

http://ajmas.dyndns.org/css/main.css

Does anyone have any ideas as to what I am doing wrong, or at the very
least what tweaks I need to get it to work in IE?

Andre


Posted by Beauregard T. Shagnasty on November 14, 2007, 12:13 pm
Please log in for more thread options
Andre-John Mas wrote:

> I have the following web site:
>
> http://ajmas.dyndns.org/
>
> This displays fine in Safari and Firefox, but in IE I am having the
> following issues: ...

The construction of the page is out of whack. You have the contents of
the <head> mixed in with the <body>. And your DOCTYPE is buried down
there as well. Fix all that, get no errors, and try again.

<http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fajmas.dyndns.org%2F>
<http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A%2F%2Fajmas.dyndns.org%2F>

--
-bts
-Motorcycles defy gravity; cars just suck

Posted by Andre-John Mas on November 14, 2007, 3:05 pm
Please log in for more thread options
On Nov 14, 12:13 pm, "Beauregard T. Shagnasty"
> Andre-John Mas wrote:
> > I have the following web site:
>
> > http://ajmas.dyndns.org/
>
> > This displays fine in Safari and Firefox, but in IE I am having the
> > following issues: ...
>
> The construction of the page is out of whack. You have the contents of
> the <head> mixed in with the <body>. And your DOCTYPE is buried down
> there as well. Fix all that, get no errors, and try again.

I have now made changes to ensure that the doctype is included and
that it conforms to XHTML, using validator.w3.org.
After having done this my site still has issues in IE 7. Specifically
the content of the 'page_content' is not staying within its div. I
have specified the div with the following CSS:

#page_content {
        float: left;
        padding: 20px;
        width: 660px;
voice-family: "\"}\"";
        voice-family:inherit;
        text-align:justify;
        overflow: auto;
        background-color: #ffffff;
}

It is meant to stay within the div and if there is too much horizontal
text, then it should preferbly wrap, but I would accept having scroll-
bars.

Andre


Posted by Andre-John Mas on November 14, 2007, 3:15 pm
Please log in for more thread options
> On Nov 14, 12:13 pm, "Beauregard T. Shagnasty"
>
> > Andre-John Mas wrote:
> > > I have the following web site:
>
> > > http://ajmas.dyndns.org/
>
> > > This displays fine in Safari and Firefox, but in IE I am having the
> > > following issues: ...
>
> > The construction of the page is out of whack. You have the contents of
> > the <head> mixed in with the <body>. And your DOCTYPE is buried down
> > there as well. Fix all that, get no errors, and try again.
>
> I have now made changes to ensure that the doctype is included and
> that it conforms to XHTML, using validator.w3.org.
> After having done this my site still has issues in IE 7. Specifically
> the content of the 'page_content' is not staying within its div. I
> have specified the div with the following CSS:
>
> #page_content {
> float: left;
> padding: 20px;
> width: 660px;
> voice-family: "\"}\"";
> voice-family:inherit;
> text-align:justify;
> overflow: auto;
> background-color: #ffffff;
>
> }
>

I solved the issue. The actuall CSS was:


#page_content {
float: left;
padding: 20px;
width: 660px;
//width: 100pc;
voice-family: "\"}\"";
voice-family:inherit;
text-align:justify;
overflow: auto;
background-color: #ffffff;
/*width: 480px; */
}

I thought the commented out sections weren't an issue so I omitted to
include them in my question. In fact they were the cause of the issue.
It turns out that IE7 does not support double-slash '//' comments,
where most browsers, that I have tested with, do. The result was that
IE was actually interpreting 'width: 100pc' when the other browsers
weren't. The solution was either to remove the offending entry or use
C style /* */ comments.

Andre



Posted by Beauregard T. Shagnasty on November 14, 2007, 4:25 pm
Please log in for more thread options
Andre-John Mas wrote:

> I thought the commented out sections weren't an issue so I omitted to
> include them in my question. In fact they were the cause of the
> issue. It turns out that IE7 does not support double-slash '//'
> comments,

Nor should any other browsers. Heh. After seeing the original markup, I
never got that far.

> where most browsers, that I have tested with, do. The result was that
> IE was actually interpreting 'width: 100pc' when the other browsers
> weren't. The solution was either to remove the offending entry or use
> C style /* */ comments.

..or CSS style comments. What is 100pc ?

You still have a lot of errors. Until those are fixed, all bets are off!
<http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A%2F%2Fajmas.dyndns.org%2F>

--
-bts
-Motorcycles defy gravity; cars just suck

Similar ThreadsPosted
Centering a DIV within a DIV? October 27, 2005, 2:31 pm
Centering a Table April 11, 2008, 2:07 pm
centering page April 29, 2008, 1:06 am
Various Issues ... January 17, 2005, 4:32 pm
Centering floating objects September 11, 2004, 10:27 pm
centering a div inside of a div in FireFox May 24, 2005, 2:02 pm
Vertically centering tables September 19, 2005, 5:21 pm
centering web site pages July 13, 2006, 8:00 am
fieldset around form -or- centering within div??? January 31, 2007, 12:39 pm
centering text vertically in div November 9, 2007, 1:39 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap