首页 > 为什么用thinkphp总是提示css错误?

为什么用thinkphp总是提示css错误?

我这个thinkphp默认的用的是Smarty模板引擎 但是我并没有学过smarty 一开始我以为是引入文件的路径的问题 改了还是不行

*Syntax Error in template "D:/wamp/www/a/shop/Admin/View\Boot\zhuye.html" on line 12 "div{text-align: center;}" - Unexpected ": ", expected one of: "}" , " "
错误位置
FILE: D:\wamp\www\a\ThinkPHP\Library\Vendor\Smarty\sysplugins\smarty_internal_templatecompilerbase.php  LINE: 621*

<!DOCTYPE html>
<html>
<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <title></title>
   <link href="{$smarty.const.ADMIN_CSS_URL}bootstrap.css" rel="stylesheet">
   <script src="{$smarty.const.ADMIN_CSS_JS}ajax.js"></script>
   <script src="{$smarty.const.ADMIN_CSS_JS}jquery.min.js"></script>
   <script src="{$smarty.const.ADMIN_CSS_JS}bootstrap.js"></script>
   <style type="text/css">
   div{text-align: center;}
   #form1 div{margin-bottom: 15px;}
   </style>
</head>
<body>
   <div class="container" style="
   margin-top: 100px;">
     <form id="form1">
        <div class="form-group" id="div1" style="width:65%">
         <label class="col-sm-5 col-md-5 col-lg-3 control-label" style="text-align:right;height:34px;line-height:32px;"  for="inputError">
          输入错误
         </label>
         <div class="col-sm-7 col-md-7 col-lg-9">
           <input type="text" id="ipt1" class="form-control" id="name" 
         placeholder="请输入用户名">
         </div>
        </div>
     </form>
   </div>
</body>

on line 12 "div{text-align: center;}" - Unexpected ": ", expected one of: "}" , " "
<style type="text/css">
   div{text-align: center;}
   #form1 div{margin-bottom: 15px;}
   </style>

看错误提示就知道了。。。。 tp在模板中无法接下 css 的{ }, 你把自定义的css 写入一个css文件,然后引入

【热门文章】
【热门文章】