Forum Moderators: not2easy

Message Too Old, No Replies

Imported style sheets and PHP

Is there a different way to do it?

         

Spook

8:01 pm on Aug 8, 2003 (gmt 0)

10+ Year Member



Hi

I have been developing a new site using PHP and MySQL.

If I place the stylesheet in the head of the document, all works OK and everything is styled as expected. However, if I import the stylesheet, it is ignored and nothing gets styled.

So, am I missing something? Is there a different way of doing this when using PHP?

I am importing using the following:

<style type="text/css">
<!--
@import url("../../../blah.css");
-->
</style>

The document I am importing to has an .ihtml extension.

Hope I have given enough information.

Many thanks

Spook

Ryan8720

10:27 pm on Aug 8, 2003 (gmt 0)

10+ Year Member



<style type="text/css">
<!--
@import "../../../blah.css";
-->
</style>

Make sure the path is correct.

toothfish

3:09 am on Aug 9, 2003 (gmt 0)

10+ Year Member



You could do this

<style type="text/css">
<?php
include '../../../style.css';
?>
</style>

it's handy if you want to see the css and the html in one document. I wouldn't leave it like that though.

Spook

5:37 am on Aug 9, 2003 (gmt 0)

10+ Year Member



The PHP include was a good idea toothfish I never thought of that.

And you were both right, it was the path that was incorrect for some strange reason.

I use Dreamweaver MX, though of late I seem to do more hand coding. The original path to the css file was the same though whether I created it, or it was created by Dreamweaver [on a point and click basis], so I was surprised when it was wrong. I have now replaced it with an absolute path:

@import "C:/phpdev/www/website/style.css";

and it works fine.

Could the problem be because I am using a local server, ie phpdev on my own pc?

Thanks for your advice.

Spook

coopster

1:53 pm on Aug 11, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Check the MIME type in your server configuration. See this thread [webmasterworld.com ]

<Edited>
Oops, sorry, I see once you fixed the path it did work correctly.
<Edited>

Spook

6:18 am on Aug 12, 2003 (gmt 0)

10+ Year Member



Many thanks for the information coopster.

I am still having problems with Netscape displaying properly on my local server but when I upload to a remote, all seems to work OK. Looks like it could be the mime type problem you refer to so I will look into that later today.

Spook.

DrDoc

2:32 pm on Aug 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Remove the HTML comments...