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 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站