FF loads CSS differently on refresh
I've added a little jQuery enabled promotional ad to the header of our website. Debugged it in FF and verified that it's working in IE.开发者_Python百科 I start going around the office and noticed that in FF, whenever a person hits the page "for the first time only", the position of the ad is not correct (using absolute positioning). Refresh the page and it will load as I expected / intended for it to load. IE seems to be working. Anyone have any idea why FF would render differently on refresh when I didn't make any code changes?
http://stormsmart.com
One option keeping it simple is a query string, look how SO does this:
<link rel="stylesheet" href="http://sstatic.net/so/all.css?v=6322">
Just stick a query string that changes when you do a release on there...used for nothing but browser cache invalidation. This will make browsers fetch a new copy when you change it.
I use this and modify it as part of our build process, the query string is the
?v=Major.Minor.Rev.Changeset
When we do a production push, client get new CSS.
Are you giving the image a size (height/width)? If not, depending on placement, browsers don't know the size of the image and place it somewhere it thinks it fits but may not be what you have in mind. If you hit refresh, it already knows the size of the image and then "fixes" it.
精彩评论