|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS only works after refresh?
I have a page with CSS that only seems to work after the page is refreshed.
http://machinemess.singaporeanimenews.net/0index.php When you first access the page url, you see the html text, but the styles defined in my styles.css do not get applied. However, when you click 'refresh', the styles appear alright. Is there a reason for this? This is the style definition I have in 0index.php: Code:
<html>
<LINK REL="SHORTCUT ICON" HREF="mm.ico">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="reply-to" content="NOSPAMadmin@singaporeanimenews.net" />
<meta http-equiv="imagetoolbar" content="no" />
<meta content="TRUE" name="MSSmartTagsPreventParsing" />
<head>
<title>Machine Mess Singapore Modeling Community</title>
<style type="text/css" media="screen">
@import url( mm-styles.css );
#banner {
margin: 2em auto;
background-image: url(mm-logobig.jpg);
background-color:#fff;
color:#000;
height:140px;
width:830px;
border-top:0px solid #000;
border-right:0px solid #000;
border-left:0px solid #000;
voice-family: "\"}\"";
voice-family: inherit;
}
</style>
</head>
..
..
..
|
|
#2
|
||||
|
||||
|
It's caused by the use of @import. An alternate method is to use
Code:
<link rel="stylesheet" type="text/css" href="mm-style.css" /> |
|
#3
|
|||
|
|||
|
May I know what's the exact problem the @import is causing?
|
|
#4
|
|||
|
|||
|
In addition, this doesn't seem to work.
<LINK REL="SHORTCUT ICON" HREF="mm.ico"> The file exists.. I'm trying to make IE use this icon when the page is bookmarked. |
|
#5
|
|||
|
|||
|
Changed the style sheet line, but the problem is the same. It only works after I refresh the page.
Code:
<html>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="reply-to" content="NOSPAMadm@singaporeanimenews.net" />
<meta http-equiv="imagetoolbar" content="no" />
<meta content="TRUE" name="MSSmartTagsPreventParsing" />
<head>
<title>Machine Mess Modeling Community</title>
<LINK REL="SHORTCUT ICON" HREF="mm.ico">
<link rel="stylesheet" type="text/css" href="mm-styles.css" />
<style type="text/css" media="screen">
#banner {
margin: 2em auto;
background-image: url(mm-logobig.jpg);
background-color:#fff;
color:#000;
height:140px;
width:830px;
border-top:0px solid #000;
border-right:0px solid #000;
border-left:0px solid #000;
voice-family: "\"}\"";
voice-family: inherit;
}
</style>
</head>
Is there a way to make the browser load the CSS before it loads the html on the page? |
|
#6
|
|||
|
|||
|
Quote:
No! The html text is NOT completely there when first loading the page. All lines up to the point '1 Guests, 1 Users' are not present (according to View Page Source). I think your PHP code is faulty at some point. My first guess: it tries to set an http-header too late in the process. If I remove the session id/cookie using my cookie manager, and then refresh, it's as wrong as first loading the page. Hope this helps, Jeroen |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS only works after refresh? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|