CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 3rd, 2003, 10:21 PM
Saus Saus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 63 Saus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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>
..
..
..

Reply With Quote
  #2  
Old June 3rd, 2003, 10:38 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,299 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 1 h 54 m 17 sec
Reputation Power: 760
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" />

Reply With Quote
  #3  
Old June 3rd, 2003, 10:48 PM
Saus Saus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 63 Saus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
May I know what's the exact problem the @import is causing?

Reply With Quote
  #4  
Old June 3rd, 2003, 10:49 PM
Saus Saus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 63 Saus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #5  
Old June 4th, 2003, 03:32 AM
Saus Saus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 63 Saus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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?

Reply With Quote
  #6  
Old June 4th, 2003, 06:33 AM
jerom jerom is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Posts: 1,014 jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 17 h 34 m 25 sec
Reputation Power: 9
Quote:
When you first access the page url, you see the html text, but the styles defined in my styles.css do not get applied.

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS only works after refresh?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway