I’m sure this is very much a beginner’s question. I have a web page which has php code in it and which has several include statements at the start of the body for files containing various functions as well as links to css and js files in the head section.
On this page I have a couple of simple, empty boxes created by a <style> section in the <head>. These are initially turned off on load.
The problem is that when the page loads these boxes are displayed for a fraction of a second before they are hidden. Is there a solution to this?
Thanks
Tony
I assume that you are hiding them with JavaScript and only if Javascript is present so the page has to load first and then if JavaScript is available the element is hidden. This does of course mean you get the initial flash of content.
You can get around this by hiding the element with CSS but through JavaScript. Either by document write or some other method.
You could of course hide it with css directly but then those with JS disabled won’t get the element turned back on.
Paul,
Thanks. I found on another site the suggestion that running the page through a validator and fixing the errors might cure it. So I did, and there were lots. Now they’re all fixed it doesn’t seem to be a problem anymore. So that’s a lesson learned.
Thanks again
Tony