hi, im using smarty with php.. everything is ok except dealing with css..
e.g: in template.tpl

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
...
<body>
..
   <td class="navText">hello world</td>
 

index.php

<?php

// load Smarty library
require('C:/Smarty/libs/Smarty.class.php');

$smarty = new Smarty();

$smarty->template_dir = 'c:/inetpub/wwwroot/smarty/templates';
$smarty->config_dir = ' c:/inetpub/wwwroot/smarty/config';
$smarty->cache_dir = 'c:/Smarty/cache';
$smarty->compile_dir = 'c:/Smarty/templates_c';

$smarty->display('template.tpl');

?>

where navText is in style.css..i've include it in
index.tpl . everything looks ok in my editor but when i run it, the style could not be seen.

pls help tks.

    Have you checked the source, and have made sure that the stylesheet is in the correct location.

    It may be in the same folder as your index.php when you intended it to be in the same one as your template.

      yup it is correct.. apparently the style can be seen in dreamweaver but not when i run it.

        It is resolved now or there is still a problem?

          And you have checked that the CSS and the template are correctly linked, (view source?)

            yes.. template.tpl and style.css are both in the same folder. i supposed this is correct '<link rel="stylesheet" type="text/css" href="style.css">'.. furthermore i could see the style in dreamweaver..but not when i run it.. do i have to include it in index.php??

              to double check, for css it should be this way rite:
              .navText {
              font-size: 12px;
              color: #1C2F8D;
              font-weight: bold;
              height:16px;
              width:119px;
              vertical-align:top;
              }

                solved it. but is very weird. apparently i place my index.tpl and style.css in c:/Inetpub/wwwroot/project/Admin/templates. it could not work until i start copying and paste my style.css everywhere n it works in c:/Inetpub/wwwroot/project/Admin/

                  Write a Reply...