PHP and MySQL programming (version 3rd) -- 19.7 use CSS with Smarty

Source: Internet
Author: User

Those familiar with CSS will soon find that there is a conflict between the syntax of Smarty and CSS, because both must use braces ({}). If the CSS Tag is simply embedded in the HTML document header, the "unidentifiable tag" error will occur:

Don't worry, because we have three solutions.

Q: Use the link tag to extract style information from another file:

Q uses the literal tag of Smarty to enclose the style sheet information. These tags tell Smarty not to parse any content in the tag:

Q: Modify the default delimiter of Smarty. You can set the left_delimiter and right_delimiter attributes to achieve this:

Although the three solutions can solve the problem, the first one is probably the most convenient, because it is a common practice to put CSS in a separate file. In addition, this solution does not need to modify the important default configurations (delimiters) of Smarty ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.