Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script not positioning in IE8 1

Status
Not open for further replies.

RP1America

Technical User
Aug 17, 2009
221
US
I am having a hard time positioning an external js script on my site in IE8 (works in previous versions). I am wanting it centered, yet it is positioning left inside its parent.

Here's an excerpt:

Code:
<div id="center">
<div id="bottom">
<script type="text/javascript" src="//tracedseals.starfieldtech.com/siteseal/get?scriptId=siteSeal&amp;sealId=55e4ye7y7mb73ad5f8b9f3c0e5d53uw79103y7mb7355e4ye7947991334978a9b" id="siteSeal"></script>
<br /><br /><br /></div>
</div>

Code:
#center {
 text-align: center;
}

#bottom {
 float: left;
 width: 720px;
 padding: 12px;
 border: 0px;
 height: 70px;
 background-image:url('images/bg_seal.jpg');
 background-repeat:repeat-y;
 margin: 0px 0px 4px 0px;
 background-color:#000000;
}

Any thoughts?
 
Well, tried this (padding) and it worked. Not sure it's the best way but it works. Am hoping it will look how I am wanting it in other IE versions as well.

Code:
#bottom {
 float: left;
 width: 720px;
 padding: 0px 300px;
 border: 0px;
 margin: 0px 0px 4px 0px;
 background-color:#000000;
}
 
So although my above solution worked in IE8, it didn't render as I though it would in IE7. Instead, it now pushed the script(image) all the way to the right side of the block.

What gives?
 
I' confused, You say you want it centered, but you are floating it left. Obviously floating it left, pushes it to the left.

However the final effects are a bit unclear, because we don't really know what is acting on your #center div. Since it has no width, it will most likely be as wide as its container.

And since your #bottom div is not considered text the centering doesn't actually apply.

If you want the bottom div to be centered inside the center div, remove the float, and set its margin-left and -right to 'auto';

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top