开发者

External stylesheet not working for one div in safari but other divs work fine?

I have a very obscure problem and I can't work out why it might be, I have a site i'm building and at the bottom of it i have a very simple footer with a link in it:

<div id="sitefooter">
<a href="#">This is the link</a>
</div>

I style this (alongside many other things) in the associated stylesheet like so:

#sitefooter {
float: right; width: 235px; margin: 10px 0 20px 0; text-align: center; font-size: 0.85em;
}

The page (using lots of CSS) displays absolutely perfectly on all browsers except Safari which works perfectly apart from this final div which shows up but ignores all the external styling. No matter what I do it just won't pick up styling for this one solitary div (it just uses the main body text styles), i've tried changing names in case there was a conflict and this doesn't fix开发者_如何学JAVA it either. If i add inline styling then it works perfectly in safari as well. An additional thing i noticed: This is an addon domain (so the domain is mapped to /website/ folder on the server) and what's even more strange is when i view it from the root domain (www.rootdomain.com/website/index.php) and include the stylesheet relatively then it works fine in safari too.

I can't work out what to do as everything seems to be conflicting, safari can read the stylesheet as everything else is working on that page on safari and it works perfectly in all other browsers (and is about as simple as it gets) so i can't see there's anything wrong there. And when i include the same styling as inline styles then it works in safari too.

Any pointers or suggestions (or ideas of anything safari might be doing!) would be massively appreciated as i'm rather confused!

Thanks so much as ever everyone!

Dave


Validate the HTML, and the CSS, to check if there are any serious errors in the code.

As the code you are showing is perfectly fine, it's likely that the problem is somewhere else in the code, It could for example be an error in a previous rule in the style sheet, that keeps the #sitefooter rule from being parsed correctly.


This was a cache issue :) you can disable safari cache here

  1. Delete the Safari cache folder. This should be in ~/Library/Caches/Safari/.
  2. Create an empty text document and save it as 'Safari' (no extension) and place in ~/Library/Caches/. I think just about any type of Document would work for this, just make sure the name of the file matches the name of the old folder, this way, a new folder can't be created by Safari when one is needed
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜