CSS problem - no style on start

I hope this is the correct forum for CSS queries.<br />
<br />
Anyway - I am using CSS, but when the page opens for the first time the stylesheets are ignored. On refreshing the page, the stylesheets are obeyed and it all looks good.<br />
<br />
When I go way and load another page, then return through a hyperlink, there is no style again. Refreshing again clears the problem. I have no idea what is going on<br />
<br />
<br />
<br />
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"><br />
<!-- this would go at the end of the doctype normally: "http://www.w3.org/TR/REC-html40/loose.dtd" --><br />
<br />
<html xmlns:v="urn:schemas-microsoft-com:vml"><br />
<br />
<!-- This site and the information represented on this site are copyright of Sauter Automation Limited --><br />
<!-- Site design by Stuart Jones --><br />
<br />
<head><br />
<br />
<style><br />
v\:* {behavior:url(#default#VML);}<br />
</style><br />
<br />
<br />
<title>novaNet Cable and Network Calculator - Results</title><br />
<br />
<link rel="stylesheet" type="text/css" href=http://www.htmlforums.com/archive/index.php/"../../../styles/table.css" /><br />
<link rel="stylesheet" type="text/css" href=http://www.htmlforums.com/archive/index.php/"../../../styles/body.css" /><br />
<link rel="stylesheet" type="text/css" href=http://www.htmlforums.com/archive/index.php/"../../../styles/div.css" /><br />
<br />
<br />
</head><br />
<body class="sub"><br />
<br />
<br />
<center><br />
<table width=350 border="0"><br />
<tr><br />
<td align="center" width="100%"><br />
<h3>novaNet Cable and Network Calculator - Results</h3><br />
</td><br />
</tr><br />
<br />
<tr><br />
<td><br />
<table class="c_result"><br />
<tr><br />
<td class="c_result"><br />
Cable Name:<br />
</td><br />
<br />
<td class="c_result"><br />
Datwyler Uninet 8002 4P<br />
</td><br />
</tr><br />
<br />
<tr><br />
<td class="c_result"><br />
Capacitance:<br />
<br><br />
<br><br />
<br />
Resistance:<br />
</td><br />
<br />
<td class="c_result"><br />
46.00 pF/m<br />
<br><br />
<br><br />
<br />
57.00 O/km <br />
</td><br />
</tr><br />
</table><br />
</td><br />
</tr><br />
</table><br />
</center><br />
<br />
<br />
<br />
<br />
</body><br />
</html><!--content-->I'm not sure how to solve that problem, but I do know that your code is not valid. The first problem I see is that you are using XML style code all over but you declared the doctype as HTML 4.01 Transitional. You need to pick which one you are using and stick with it. If you want to use HTML 4.01, and I don't see why you couldn't from this code, you need to first fix the declaration.<br />
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"<br />
"http://www.w3.org/TR/REC-html40/loose.dtd"><br />
You also need to remove the "/" at the end of the link tags. In XML, the "/" is the proper way to close a tag that doesn't have it's own way of closing, but HTML 4.01 does not recognize that. You also need a "type" attribute in your style tag. Although, I have no idea what that bit of code is accomplishing.<br />
<style type="text/css"><br />
That should make your code valid. As for whether or not that will fix your problem, I don't know, but it can't hurt.<br />
<br />
Doog Xela<!--content-->If I use the doctype as you suggested, then certain elements (ie, <iframe>) will not render in IE6.0. I did this after scoutt suggested it to me in this thread (<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=16940">http://www.htmlforums.com/showthread.ph ... adid=16940</a><!-- m -->) <br />
<br />
I realise that i have not used <iframe> in this page, but the head is from a common .php file.<br />
<br />
------------------------------------<br />
<br />
I have put the "/>" at the end of the <link> at the recomendation of the w3schools tutorial (<!-- m --><a class="postlink" href="http://www.w3schools.com/css/css_howto.asp">http://www.w3schools.com/css/css_howto.asp</a><!-- m -->) <br />
<br />
I did not put them in at first (bad copying on my behalf) and the links to the style sheets did not work.<br />
<br />
------------------------------------<br />
<br />
xml.<br />
<br />
are you saying that i can either have the doctype declare the transitional standard, or have the xml attribute in the <html> tag, but not both?<br />
<br />
ok, I can live with that, but I need xml so the transitional standard is out of the window.<br />
<br />
the style declaration :<br />
<br />
<br />
<style><br />
v\:* {behavior:url(#default#VML);}<br />
</style><br />
<br />
<br />
is a direct copy from microsoft (<!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/vml/default.asp">http://msdn.microsoft.com/library/defau ... efault.asp</a><!-- m -->) 's own vml/xml recomendation as submitted to w3c.<br />
<br />
-------------------------------<br />
<br />
thanks for your input Alex, but this is the only page where i am having problems. All of the others are rendering fine, and the <link> and <html> declarations are common to all pages.<!--content-->If you need the XML, try this declaration:<br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"><br />
<br />
Or, I believe the frameset version of the doctype supports iframes.<br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"<br />
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><br />
<br />
I'll have to read up on VML. I'd not heard of it. I'm beginning to show my lack of expertise. Unfortunately, I don't know how to solve that problem. I'll try and recreate it here, and then come up with a solution, but I can't think of anything off hand.<br />
<br />
Doog Xela<!--content-->
 
Back
Top