Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 9 votes, 3.33 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-04-2003, 10:41 PM   PM User | #16
STDestiny
Regular Coder

 
Join Date: May 2003
Location: Manassas, VA, USA
Posts: 220
Thanks: 0
Thanked 0 Times in 0 Posts
STDestiny is an unknown quantity at this point
Actually, I fixed it. I changed the file from styles.css.php to styles.css (I was going to have .php in case I ever wanted to do anything with PHP on it, like letting users specify there own colors, but I guess is has to be .css)

Thanks for all the help.

-Andrew
STDestiny is offline   Reply With Quote
Old 09-04-2003, 11:44 PM   PM User | #17
krycek
Regular Coder

 
Join Date: Nov 2002
Location: Bristol, UK
Posts: 932
Thanks: 0
Thanked 0 Times in 0 Posts
krycek is an unknown quantity at this point
Quote:
Originally posted by MotherNatrsSon
If you are on an Apache server there is a bug that does not allow Mozilla to upload stylesheets because it changes the mime type to text/plain instead of text/css.

I'll dig up the link for the info and get back to you on it.

MNS
Quote:
Originally posted by MotherNatrsSon
Even though you call the correct mime type the Apache server "serves" the wrong mime type. Mozilla being standards comliant will not load a style shett served as text/plain which is what the server bug does. Read the link I posted.

MNS
...it's not a bug. It just happens when Apache is not configured properly. If Apache is set up to serve that MIME-type, it will, just like with other stuff. So, user setup error, not bug...

Apart from that, you are correct. The trouble is that some servers simply are not set up to serve CSS properly, and IE will accept the file even if the wrong MIME-type is being served. Like you said, Mozilla will stick to the standards and not use it.

::] krycek [::
__________________
ithium | SOAPI | SDP | PTPScript manual
"ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."
krycek is offline   Reply With Quote
Old 09-05-2003, 02:16 AM   PM User | #18
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Quote:
Originally posted by STDestiny
Actually, I fixed it. I changed the file from styles.css.php to styles.css (I was going to have .php in case I ever wanted to do anything with PHP on it, like letting users specify there own colors, but I guess is has to be .css)
Don't give up man - I do this - and all you have to do is send a content-type header at the top of the stylesheet:
PHP Code:
<?php 
header
("Content-type: text/css"); 
?>
Then you can do all kinds of groovy ting:
PHP Code:
<?php 
session_start
();
header("Content-type: text/css"); 
if(
$_SESSION["linear"] == "no")
{
    echo(
"@import url(\"navbar.css\");\n"); 
}
?>
@import url("main.css");
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

Last edited by brothercake; 09-05-2003 at 02:33 AM..
brothercake is offline   Reply With Quote
Old 09-05-2003, 03:29 AM   PM User | #19
DoubleV
Regular Coder

 
Join Date: Dec 2002
Location: the windy city
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
DoubleV is an unknown quantity at this point
i had the same problem just a coupel fo months ago.
also posted here about it.
may be mods should make this into a sticky as it seems quite a few people are having the same problem and teh solution is not obvious.
DoubleV is offline   Reply With Quote
Old 03-11-2005, 02:50 PM   PM User | #20
the edge
New to the CF scene

 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
the edge is an unknown quantity at this point
Hi everyone,

I am facing the same problem...my CSS isnt working properly when I start using PHP along


Now, as I figured out from this discussion, my Apache server might be configured incorrectly for this.

Problem is, I am using a free-hosting service. So is there any possible work-around to this problem using some additional coding from my side in my PHP/CSS ??

Else I'll have to contact the webmaster of my free-host.

Thanks
the edge is offline   Reply With Quote
Old 03-11-2005, 07:13 PM   PM User | #21
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
I dont know anything about an apache issue but my pages are now served up as headers and footers using php.

This is the start of my html in the header and the css works fine. (well about as fine as I can make it

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 

<head>
  
<title>Sample Site #1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  

<link rel="stylesheet" href="http://cms.mydomain.com/stylesheets/html/globalstyle.css" type="text/css">
I hope that helps


Bazz
__________________
"The day you stop learning is the day you become obsolete"! - my late Dad.

Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
Useful MySQL resource
Useful MySQL link
bazz is offline   Reply With Quote
Old 04-26-2006, 03:34 PM   PM User | #22
Tyrial101
Regular Coder

 
Join Date: Apr 2006
Posts: 117
Thanks: 2
Thanked 0 Times in 0 Posts
Tyrial101 is an unknown quantity at this point
Hello. I am having a similar problem. Netscape and IE are rendering my index.php with css, but Firefox, for some reason is not. I have used the Web Developer tool for Firefox, on my CSS file and It is telling me that the type is infact text/css and the encoding is utf-16 (although I set it to utf-8)

I have validated my HTML as 4.01 Transitional, and have validated my CSS. I get about 10 warnings, but only for netscape 4.0 which doesn't recognize the Height attribute.

I am beginning to believe it is a server problem, but I am not sure how. This page will not load CSS or PHP yet other sites on teh server will.

the link for this page is
http://bpa.tisd.k12.mi.us/Link-up (no www.)
the style is external and located at link-up/main.css

Here is my code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>
Link-Up :: Home >> Where people link up!
</title>



<meta name="keywords" content="friends networking sharing photos finding friends blogs journals blogging journaling bands music rate pics join groups forums online social">

<meta http-equiv="expires" content="0">
<meta name="description" content="Link-Up. Where people in your area can link up and make friends, chat, and cruise the forums.">

<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<center>
<table border="0px" cellspacing="0px">
<tr>
<td class="head" colspan="2" valign="bottom">
<span class="lf">Link-Up</span><div id="loginmain">Login | Register</div>
</td>
</tr>
<tr>
<td class="topnav" colspan="2">
<a class="top" href="index.php">Home</a> | Login | Link | Link | Link | Link | Link | Link | Link | Link | Link
</td>
</tr>
</table>

<table border="0px" cellspacing="0px">



<tr>
<td class="leftnav" valign="top">
<h4>Navigation</h4><br>
<a href="index.php">| Home |</a><br>
| Link |<br>
| Link |<br>
| Link |<br>
| Link |<br>
| Link |<br>
| Link |<br>
| Link |<br>
| Link |<br>
</td>


<td class="main" valign="top" rowspan="2">



This is body text in here




</td>

</tr>
<tr>
<td class="leftnav2" valign="top">

<h4>Top Rated</h4>



</td>


</tr>
</table>
</center>


</body>
</html>







Now here is the CSS code

body {
background: #000000;
color: #0066FF;
}


a:link {
color: #0099FF;
text-decoration: none;
}

a:visited {
color: #0066FF;
text-decoration: none;
}

a:hover {
background-color: #0099FF;
color: #000033;
text-decoration: none;
}


a:active {
color: #0099FF;
text-decoration: underline;
}




a.top:link {
color: #0099FF;
text-decoration: underline;
}

a.top:visited {
color: #0066FF;
text-decoration: underline;
}

a.top:hover {
background-color: #0099FF;
color: #000066;
text-decoration: underline;
}

a.top:active {
color: #0099FF;
text-decoration: underline;
}


.head {
background: #000033;
height: 50px;
width: 900px;
padding: 5px;
}


.topnav {
background: #000066;
height: 15px;
width: 900px;
font-size: 12px;
text-align: center;
word-spacing: 5px;
}

.leftnav {
background: #000033;
width: 100px;
height: 225px;
text-align: center;
padding: 20px;
}

.lf {
font-size: 200%;
font-variant: small-caps;
text-align: center;
font-weight: bold;
}

.leftnav2 {
background: #000033;
width: 100px;
height: 300px;
text-align: center;
padding: 20px;
}


.main {
text-align: left;
background: #000000;
width: 730px;
height: 600px;
padding: 20px;
}

#loginmain {
text-align: right;
}

Any help, whether telling me that the server is being dumb, or that I am being stupid, or that its a little mistake, would be appreciated

Thanks guys.
Tyrial101 is offline   Reply With Quote
Old 04-26-2006, 03:46 PM   PM User | #23
Tyrial101
Regular Coder

 
Join Date: Apr 2006
Posts: 117
Thanks: 2
Thanked 0 Times in 0 Posts
Tyrial101 is an unknown quantity at this point
Apparently this site is God. Shortly after posting my question, I resaved my index.php (changing nothing.) and suddenly all my CSS worked. Thanks for the help that you would have given me.
Tyrial101 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:55 PM.


Advertisement
Log in to turn off these ads.