Jump to content

[SOLVED] styles acting strangely in IE7 but work on refresh


pquery

Recommended Posts

I've created a style sheet which works perfectly in FF, but on the initial page load in IE7 the div which holds the person's information (#welcomeBox) is up about 100 pixels and to the right about another 30 pixels in IE until you click refresh on the page and then it goes back to where it's supposed to be.

 

Most users would not do this (nor should they have to)

 

Here is the style from my css:

#welcomeBox {

display: block;
background-color: #4d84c4;
font-family: Arial,sans;
height: 150px;
width: 165px;
color: #ffffff;
float: left;
z-index: 50;
margin-left: 10px;
margin-top: 5px;
padding-left: 10px;
margin-right: 20px;
}

 

I'm not sure if it's the display:float that would cause this or what would make IE7 do this or if someone would have a decent solution (or hack even). This welcome box is on almost every single page and IE7 seems to be what over 90% of my visitors are using.

 

thanks for your help / suggestions.

Link to comment
Share on other sites

I couldn't add a link because the site I'm building is only accessible from outside the network via VPN.

 

I did however solve the problem and will say a little bit about what happened for other's who might encounter this at a later time. First let me say that this site was built in Smarty so it was the template (or .tpl) page(s) which I was having problems with.

 

I had built a top (nav) bar to be included on almost every page and had put that {include file="nav.tpl) as the first line of my template file.

 

THEN - I had my <HEAD> <include css>and <TITLE> tags. (I have a lot of custom scripts on most pages which don't seem to be served well by just the standard template.tpl file) Well, Firefox was smart enough to read that there was a stylesheet to include. but IE couldn't get past the fact that the <HEAD> tag was not the first set of tags on the page.

 

Once I moved the {include file="nav"} below the closing </HEAD> tag and then refreshed the page(s), IE then read the link to the CSS and everything came out where it was supposed to and I could make my final style tweaks.

 

Hope this helps another Smarty user.  ;D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.