CSS :before content value changing until cache is cleared - html

I have a ul list with chevron bullet points effected by the following css code:
ul li::before {
content : "»";
padding-right: 0.3em;
}
This displays correctly initially; however after a while the bullet points change to ». This is fixed (for a while) by clearing the cache, but the problem will then recur, and I can't for the life of me work out why the extra character is appearing. I have tried content: "\»" and content: "\00bb", but the same problem happens.
This happens in Chrome and I think also Safari, in my local development environment as well as on the live website (http://markfisher.photo - the list in question is at the bottom under "Me elsewhere").
Further Info (Quite confusing, but if you follow you may be able to force the problem to manifest itself in Chrome):
Interestingly, looking at my live website now, even though it displays correctly on the page, upon inspecting the list, Chrome devtools says that the css is actually content: "\»". Refreshing the page with devtools open changes this, so it is then correct both on the page and in Chrome devtools. However, if I open the page (displaying correctly), open Chrome devtools (showing the extra Â) then close devtools and THEN refresh, the extra  displays on the page.
Any ideas would be much appreciated.

http://markfisher.photo/code/css/footer.css, when called directly in the browser, shows it that way already:
div.quick_links ul li::before {
content : "\»";
Switching the encoding explicitly to UTF-8 in the browser however makes it become "\»" then.
Try specifically telling the browser that this stylesheet is encoded in UTF-8, either by making the server add a charset to the Content-Type header, so that it becomes
Content-Type: text/css; charset=UTF-8
or by placing the line
#charset "utf-8";
at the very beginning of your stylesheet.

Related

Chrome rendering html/css differently on webserver vs locally

I have a strange problem with Chrome rendering a simple menu written in css and html. When I check the website on localhost everything works well but on a web server there is a bug.
Here is a link for the test website http://slitest.me.pn/menu_bug/ (saving it locally removes the bug)
I only care about chrome here. I have discovered that problem is caused by
float: left;
in
.menu li span
But what is funny, in chrome page inspector I manually disabled and enabled this parameter and everything started working fine, but after refreshing the page it is wrong again... no idea what is happening.
Here's the results I'm getting (localhost is what I assume to be correct):
Try to use margin-left instead of float:left

Glyphicons blink on refresh in chrome

I'm using Bootstrap glyphicons. They are working nicely, but with Chrome browser, the glyphicons blink when the page loads
For example:
Open this link on Bootstrap:
http://getbootstrap.com/components/#glyphicons-glyphs
Once loaded, Press F5 or refresh.
You will see the glyphicons blink.
How can I fix it so they don't blink?
Here's a screenshot:
Note: This only happens in Chrome, not FF or IE.
Generally, this is a problem with having a flash of unstyled content (FOUC).
Specifically, this is what Paul Irish calls a flash of unstyled text (FOUT):
In Firefox, basically the text is in a default webfont until the custom font is ready
Webkit takes a very different approach, and very intentionally. They believe it’s better to keep the text invisible until the font is ready. This way, there is no moment where the text flashes into its newly upgraded self
In other words, this issue isn't so easily overcome.
You can attempt to minimize the impact by:
Using gzip to shrink the file so it downloads quicker
Using caching so the client can use an existing copy rather than grabbing a new one.
The heavy handed approach would be to wait to display the page to the user until everything was rendered, but I would strongly recommend against this. User are very impatient for initial load times but are considerably more forgiving when it comes to rendering additional content.
The glyphicons blink/flicker on page reloads, but the bigger problem for me (I'm using Bootstrap 3) is that the page flickers as elements resize around the glyphicons. Adding this to my CSS stopped the resizing for me:
.glyphicon {
width: 14px;
height: 14px;
}
Thanks to my source: https://www.garysieling.com/blog/preventing-icon-flicker-using-glyphicons
I had exactly the same problem but solved it by adding .woff and .woff2 as new MIME-types font/x-woff in IIS.
This stopped the glyph-icons from blinking immediately as Chrome now caches the font-file correctly.
To see if this may apply to you, open the debug-console in Chrome (F12) on the site it blinks and you will find an error related to the glyph-font-files where the browser interprets them as the wrong MIME type.

Firefox will not update CSS

I have an element with the class .ui-menu .ui-menu that has the style of margin-left:25px;. I have removed this, so that it is margin-left: 0px;. However, when I refresh the page, it's still displaying this style, and the 'inspect element' window tells me that according to the css file it's reading .ui-menu .ui-menu still has a rule set for margin-left: 25px;.
I have tried using F5, Shift + F5, Shift + Ctrl + F5… I've manually cleared all cache, shut the computer down and restarted it. I'm about to uninstall Firefox completely and reinstall it to see if THAT even works. I've also tried renaming the CSS file, and re-linking to it with its new name… and then Firefox stops reading the CSS file entirely, because it's not updating the headers or footers to see that it's been changed so everything goes unstyled!
I don't have this issue in GC, Opera, Safari, not even in IE. Am I doing something wrong?
As to your questions:
I'm using Firefox instead of other browsers because I can't control what browser people who visit my site are using. As far as website design goes, this is a pretty basic understanding.
I've run the site through validation here: http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fthesciencefacility.icyboards.net%2Findex.php&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en
Most of the issues here are just cross-browser stuff, plus some embarrassing color issues. if you can find something here I can't, please mention it!
The site is not self-hosted. It's a forum service through IcyBoards, if you're at all familiar with it.

Google Chrome rendering issue, position: fixed

I have been developing a website and I have had no problems at all with it. I am now testing it on different PC's and am having a problem where the rendering breaks in google chrome. The pc's all run the same versions of chrome which is version 21.0.1180.89. On some pc's the page renders perfectly and on others, the position: fixed property is completely ignored and me page header disappears when scrolling. On inspecting the element with the chomr developer tools it says the element is there but the element is not visible. It is not a problem with z-index since I set this really high and did not fix it.
Where do I even start to look for a reason for this problem? Is this a css issue or an issue with the browser?
Thanks in advance
Edit:
The solution was found. I had set opacity: 0.99 on the body element of the document in an attempt to fix a problem with fonts displaying incorrectly on Mac's. This should be a valid css property? However it seems that on some browsers this caused the page to reder incorrectly.
The solution was found. I had set opacity: 0.99 on the body element of the document in an attempt to fix a problem with fonts displaying incorrectly on Mac's. This should be a valid css property? However it seems that on some browsers this caused the page to reder incorrectly.

Images not loading, IE6 to IE9

I'm having two problems:
My website is not forwarding from index.html on IE6 - IE9
Images are not loading on any page IE6 - IE9
For the first problem, if you go to http://www.matthallock.com/ the website cycles endlessly regardless if I link it to a file (e.g., /hamlet.html) or directly (e.g., http://www.matthallock.com/hamlet.html)
The second problem, more troublesome, is images appearing blank on Internet Explorer. Further, the problem appears to be with the jQuery, as the fixed sidebar also does not work.
I tried the degrade for the lazy load, but that doesn't solve the problem. Curiously, if you go to my blog at blog.matthallock.com, there is no issue and the styling of the sidebar appears correct.
Appearance and functionality works properly in Chrome, Safari, and Firefox.
Any help is much appreciated.
<META HTTP-EQUIV="refresh" CONTENT="0;http://www.matthallock.com/hamlet.html">
You need to specify url= before actually giving the URL, otherwise it just reloads the current page.
$("img").lazyload({
effect : "fadeIn",
/*
appear : function(elements_left, settings) {
console.log("appear");
console.log(elements_left);
//console.log(this, elements_left, settings);
},
load : function(elements_left, settings) {
console.log("load");
console.log(elements_left);
//console.log(this, elements_left, settings);
}
*/
});
Your browser console gives you this one for free: "Expected identifier, string or number" - IE does not like trailing commas in object definitions, and because of your multiline comment your resulting code is:
$("img").lazyload({effect:"fadeIn",});
See that extra comma? Remove it, and everything magically works.