Forum Moderators: not2easy

Message Too Old, No Replies

CSS and php include

         

SirTyler

3:48 pm on Aug 31, 2006 (gmt 0)

10+ Year Member


I have seen other questions similar to this one, however I have not found my question on here or anywhere else.

I have a file called top.php, then another called bottom.php, then I make my main website called index.php... now i do this so that i can change things easily, so in the top i would keep all the CSS information and META stuff, now I then do a php include in the index.php to look like this:

<? include('top.php');?>
<center><? include('links.php');?></center>

<? include('bottom.php');?>

The links is my main links for the page, they are also an include so that i can change them easily.

Now that you know my setup... my problem is-

I cannot get the CSS to work for my php files, I have checked the CSS and it looks fine, I have tried regular a:link tags, then i tried doing the class and id tags, nothing works.

I am curious if maybe the files run before they are included in php? or if they run AFTER php includes them into the page? because including both my links and my top seperatly seems that the top css wont affect the links page :S

I am sorry if i confused anyone with my horrible way of explaining things, please though if you know the answer or need more information tell me.

Tyler

DanA

4:25 pm on Aug 31, 2006 (gmt 0)

10+ Year Member



Do you include styles or the link to the stylesheet?
the included file could look like :
<?php
echo "<style type=\"text/css\">
<!--
#logo{margin:0;}
/*your styles*/
-->
</style>";
?>
or
<?php
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />";
?>

[edited by: DanA at 4:27 pm (utc) on Aug. 31, 2006]

SirTyler

5:04 pm on Aug 31, 2006 (gmt 0)

10+ Year Member



Well actually the .php file has no php in it, i just keep it php because i have a feeling i might add php to it in the future, possibly a ad banner or something and so i made it php now to keep from editing 1000 pages later.

So its just a normal html with css in the heading website. the main php page just does a normal <? include('top.php');?> and everything from the top.php works, except the css will not work with my links or anything.

I am very confused now, because i tried putting a link ref or whatever on the page the links were on to see if it was just because i was php including the files. The css still didnt work, I have no clue whats wrong

SirTyler

5:07 pm on Aug 31, 2006 (gmt 0)

10+ Year Member



<edited> <<< thats the site thats not working properly

<edit reason: no personal urls - see Charter [webmasterworld.com]>

[edited by: tedster at 6:24 pm (utc) on Aug. 31, 2006]

SirTyler

5:52 pm on Aug 31, 2006 (gmt 0)

10+ Year Member



sorry to keep replying, i keep testing it myself to try to fix it... apperantly the <font> works with CSS but the <a href> wont pick up the CSS

SirTyler

5:55 pm on Aug 31, 2006 (gmt 0)

10+ Year Member



OK I apoligize, this is totally my fault, it works now, I had forgot to close one of the CSS tags right above the a:link . I am terribly sorry, I swore i checked that thing up and down and just now noticed it.

Again, very sorry... I appreciate the reply anyways