CSS and PHP includes

baudday

New Member
Hi, so I have an index.php file which looks like this.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel=
"stylesheet" type="text/css" href="css.css" />
</head>
<body>
        <center>
                <table class="main" width="800px" border="0">
                        <table width="800px" border="0">
                                <tr>
                                        <td><?php include("includes/header.php"); ?></td>
                                </tr>
                        </table>
                        <table width="800px" border=0>
                                <tr>
                                        <td width="400px"></td>
                                        <td class="menu" width="400px"><?php include("includes/menu.php"); ?></td>
                                </tr>
                        </table>
                        <table width=800px border=0>
                        <tr>
                                <td width="200px"><h1>Left</h1></td>
                                <td width="400px"><h1>Middle</h1></td>
                                <td width="200px"><h1>Right</h1></td>
                        </tr>
                        <tr>
                                <td class="side" width="200px"><?php include("includes/left.php"); ?></td>
                                <td class="middle" width="400px"><?php include("includes/mid.php"); ?>
</td>
                                <td class="side" width="200px"><?php include("includes/right.php"); ?></td>
                        </tr>
                        </table>

                        <table width=800px border=0>
                        <tr>
                                <td width="800px"><?php include("includes/foot.php"); ?>
                        </tr>
                        </table>
                </table>
        </center>

</body>
</html>

As you can see, it is linked to several includes. My problem is I can't get my CSS,

Code:
h1 {
font:Arial 12px #cccccc;
}

body{
background: #efd68c;
font-family: Arial;
}

.middle
{
background: #efd68c;
padding: 10px;
font-family: Arial;
}

a:link, a:visited
{
text-decoration: none;
border: 1px bottom dashed grey;
}

a:hover
{
text-decoration: none;
text-color: #0d4603;
border: 1px bottom dashed grey;
}


.side
{
background: #efcb5f;
padding: 10px;
}

.menu
{
}

To alter this at all. Nothing looks like I want it to. Not even the links. I thought I knew CSS pretty well, I don't really know PHP at all, I just learned how to use includes. But I'm having a lot of difficulty with the CSS. Can anyone see anything wrong, or maybe explain what I may be doing wrong here? Thanks.
 

jnjc

New Member
There are a number of reasons that your css may not be taking effect, but it's difficult to say without a link.

1) Make sure you have the path right to your css file.
2) Clear your browser cache to make sure you not view a cached page
3) Install FF and Firebug and have a look at your page to see how the elements are styled

Failing that post a link and we can have a look.

HTH,
JC
 

baudday

New Member
Well, the link to my CSS is correct. What I have done is put the class names in the actual include files to test it out, and it does actually work that way. But that is cumbersome, and makes the whole concept of using includes somewhat obsolete. I have cleared the cache and it's not that. I installed Firebug, already using FF. I guess I can post the link, I was hoping not to have to do that. It's http://thesupportdepartment.com/index.php

I deleted the class names out of the includes files and it kept the parts of the style that was working so that's good. But the links and headers still won't change.
 

baudday

New Member
Okay, it's not quite as bad as I made it sound at first, but the links stay blue, even though I made them a different color. Also, the headers won't change.
 

zkiller

Super Moderator
Staff member
Yes, like jnjc stated, insure you have the correct path set for your css file and also clear your browsers cache. And a link would really help us to troubleshoot your issues. Would give us a better idea as what you are trying to do as well.
 

baudday

New Member
It looks like I can change the size and font-family of h1, but not the color. The links issue persists.
 

jnjc

New Member
Okay, it's not quite as bad as I made it sound at first, but the links stay blue, even though I made them a different color

I presume you are talking about the hover color on the link. You are using the wrong property to set the color:

Code:
a:hover
{
text-decoration: none;
[B]text-color: #0d4603;[/B]
border: 1px dashed bottom;
}

Should be

Code:
color: #0d4603;


Also, the headers won't change.

Not sure what you mean by this..

HTH,
JC
 

baudday

New Member
Alright, it's all about that one thing you just mentioned. color: I was using the wrong property. Thanks a lot for the help.
 
Top