Iorhael wrote:

>I have made up this site to display my computer graphics in my portfolio. 
>However, I am having a problem with the text shifting to the left in Opera and 
>Firefox (yet it looks fine in IE). Does anyone have an idea of how I might 
>prevent this from happening? Here's the link and stylesheet.
>
>http://www.drk-writing.com/artwork/
>
>http://www.drk-writing.com/artwork/artwork.css
>
>  
>

Debbie,

Any time you see one thing in FF and Opera and another in IE, you can 
safely bet that IE is the one that is doing it wrong.  Always build for 
FF first, then go back and tweak for IE if you need to.  It takes much 
less time and effort this way.

In your case, I was able to quickly see what was going on by using the 
DOM Inspector of FF, which let me outline your content div and see that 
it was sitting against the left side of the window.  Looking at its CSS 
rules, I saw that it didn't have equal width margins set on the left and 
right, and this is what is needed to center a block, like a div.  If you 
wanted to center the text within the div, you would use text-align: 
center on that div.  When IE6 is in quirks mode (as it is because you 
have not used a complete doctype on your page), it will incorrectly 
center a block using text-align center on the parent element.

I suggest you do the following:

1. Make sure you have the DOM Inspector installed in your copy of FF, 
and if not, reinstall FF and select Custom installation to get it.

2. Learn how to use the DOM Inspector:
http://www.codestore.net/store.nsf/unid/BLOG-20050228
http://www.clagnut.com/blog/340/

3. Replace the doctype on your page with this one:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>

4. Add this rule to body:
padding: 0; /* for Opera */

5. Add these rules to #content:
margin: 0 auto;

6. If you want to shift #content an extra 100px to the right to 
accommodate the background border, add these rules:
position: relative;
left: 100px;

That should get you started. :-)

Zoe

-- 
Zoe M. Gillenwater
Design Services Manager
UNC Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to