I can't seem to get a DIV tag to center. it works fine in IE8, Firefox, Safari and Google Chrome and is more or less there in Opera. In IE7 (and IE6) I can't seem to get it to work.
What I need is a box that stretches the whole length of the window whatever the screen resolution or zoom. But then I need a copyright notice inside it that lines up with the left of the main content that it centred and 980px wide.
The HTML follows:
I'm using two CSS files to keep my templates seperate from my styles. The CSS is:
And
Can anyone suggest what I'm doing wrong? I've found several sites that say either use:
or
or
Although one of these worked in IE8, Firefox, Safari, Google Chrome and Opera, none of them seem to work in IE7.
What I need is a box that stretches the whole length of the window whatever the screen resolution or zoom. But then I need a copyright notice inside it that lines up with the left of the main content that it centred and 980px wide.
The HTML follows:
Code:
<div id="footer">
<div id="footer_content">
<div id="copyright">
Copyright © [B]Copyright notice[/B] </div>
<div id="power">
Powered by <a href="[B]URL[/B]" target="_blank">[B]My Company[/B]</a>
</div>
</div>
</div>
Code:
#copyright { position: absolute; top: 80px; left: 0px; width: 790px; height: 20px; }
#power { position: absolute; top: 80px; left: 790px; width: 190px; height: 20px; }
#footer { position: relative; top: 0px; margin-left: auto; margin-right: auto; width: 100%; height: 100px; }
#footer_content { position: relative; top: 0px; left: 50%; margin-left: -490px; width: 980px; height: 100px; }
Code:
#footer { background-image:url('/images/footer.jpg'); font-weight: bolder; padding: 7px 0 0 0; margin: 0 0 0 0; color:#9596ea; text-align: center; font-family:Arial; font-size:10pt; vertical-align: middle; }
#footer_content{ text-align: center;}
#copyright { padding: 0 0 0 0; margin: 0 0 0 0; color:#ffffff; text-align: left; font-family:Arial; font-size:9pt ; vertical-align: middle; }
#power { padding: 0 0 0 0; margin: 0 0 0 0; color:#ffffff; text-align: right; font-family:Arial; font-size:9pt; vertical-align: middle; }
Code:
margin: 0 auto;
Code:
text-align: center;
Code:
width: 980px; left: 50%; padding-left: -480px;
Comment