I have a div on my page that contains breadcrumb with php code, but when I style it with css it doesn't.
I mean if I put styling code in css file & link that file to my file.php it doesn't work unless I put styling code on file.php.
any solution for this ?
Code in file.php
<div class="s_crumb">
<?php
$Pages = array(
'Clothes' => 'Clothes',
'file' => 'File'
);
$path = $_SERVER["PHP_SELF"];
$parts = explode('/',$path);
if (count($parts) < 2)
{
echo("home");
}
else
{
echo ("<a href=\"http://domain.com\">Home</a> » ");
for ($i = 2; $i < count($parts); $i++)
{
if (!strstr($parts[$i],"."))
{
echo("<a href=\"");
for ($j = 0; $j <= $i; $j++) {echo $parts[$j]."/";};
echo("\">". str_replace('-', ' ', $Pages[$parts[$i]])."</a> » ");
}
else
{
$str = $parts[$i];
$pos = strrpos($str,".");
$parts[$i] = substr($str, 0, $pos);
echo str_replace('-', ' ', $Pages[$parts[$i]]);
};
};
};
?>
</div>
CSS code
<style>
.s_crumb a {color:#848484;text-decoration:none;}
.s_crumb a:visited {color:#848484;text-decoration:none;}
.s_crumb a:hover {color:#bebebe;text-decoration:none;}
</style>
<link href="css/my.css" rel="stylesheet" type="text/css">