douqiao2471 2016-10-09 14:42
浏览 80

为什么css不影响我的PHP页面?

I am learning the php and get some difficulties, I am trying to include the php file in header of another file, but the css is not working?

here is my project directory structure Project Structure

and here is my php code... blogpage.php

 <html lang="en">
<head>   
    <?php include 'head.php';?>

    <title>Off Canvas Template for Bootstrap</title>

</head>

I have included the path in Struts-2/blogpage.php

here is my head.php

   <!-- Bootstrap core CSS -->
  <link href="/css/bootstrap.min.css" rel="stylesheet">

  <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  <link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">

   <!-- Custom styles for this template -->
  <link href="css/offcanvas.css" rel="stylesheet">
   <link href="css/blog.css" rel="stylesheet">
  • 写回答

2条回答 默认 最新

  • dpy33121 2016-10-09 14:54
    关注

    Is CSS folder located under the head.php?

    Try to add slash to all links:

       <!-- Bootstrap core CSS -->
      <link href="/css/bootstrap.min.css" rel="stylesheet">
    
      <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
      <link href="/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    
       <!-- Custom styles for this template -->
      <link href="/css/offcanvas.css" rel="stylesheet">
       <link href="/css/blog.css" rel="stylesheet">
    

    You may check, adding the links directly, without including th php. Try in that way to see if the links work.

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器