如何在smarty模板文件中包含.css文件?

时间:2022-11-22 20:09:14

Hello I am a newbie in php, html, css, and smarty. How to insert/include a css file to a html file in smarty?

你好,我是php、html、css和smarty方面的新手。如何在smarty中插入/包含css文件到html文件?

1 个解决方案

#1


4  

The answer from @Nambi Narayanan looks very wrong and badly implemented. I advise you to use the following block:

@Nambi Narayanan给出的答案看起来非常错误,而且执行得很糟糕。我建议你使用以下区块:

{block name=head}
    <link href="/css/mypage.css" rel="stylesheet" type="text/css"/>
{/block}

or you can just include the link tag straight in the page without Smarty:

或者你可以直接在页面中包含链接标签,而不需要使用Smarty:

<link href="/css/mypage.css" rel="stylesheet" type="text/css"/>

#1


4  

The answer from @Nambi Narayanan looks very wrong and badly implemented. I advise you to use the following block:

@Nambi Narayanan给出的答案看起来非常错误,而且执行得很糟糕。我建议你使用以下区块:

{block name=head}
    <link href="/css/mypage.css" rel="stylesheet" type="text/css"/>
{/block}

or you can just include the link tag straight in the page without Smarty:

或者你可以直接在页面中包含链接标签,而不需要使用Smarty:

<link href="/css/mypage.css" rel="stylesheet" type="text/css"/>