php 加载的文件 css js返回给html没有效果是什么问题呢?
问题描述
PHP代码
ob_end_clean(); ob_start(); //读取文件mimetype信息 $finfo = finfo_open(FILEINFO_MIME); $mimetype = finfo_file($finfo, $uri); finfo_close($finfo); //打开文件 $file = fopen($uri, 'r'); $file_size = filesize($uri); //声明头信息 Header("Content-type: $mimetype"); Header("Accept-Ranges: bytes"); Header("Accept-Length: ".$file_size); // 输出文件内容 echo fread($file,$file_size); fclose($file);
css内容
html{ font-size: 100px;}
html内容
自动换行 <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="http://127.0.0.1/res/public/css/style.css"> <title>test</title> </head> <body>
hello world
</body> </html>php 是这样加载css文件的:
http://127.0.0.1/res/public/css/style.css
拆解 /res/public/css/style.css
/res/ 模块
取得真实路径 wwwapppublicrescssstyle.css 并读取返回内容。
实际样式没有应用成功


这是为什么呢?跪求高手解答
问题解答
回答1:html{font-size:100px} 换成 p呢?
相关文章:
1. react-native 启动Android项目失败2. python - 用ffmpeg采集视频,用terminate没法结束进程3. node.js - vue-resource,如何改变响应格式?4. node.js - nodejs+express+vue5. nginx - 关于vue项目部署到ngnix后出现的问题6. 网站在移动的环境下手机,pc打不开7. css - 关于HTML中width和height的疑问(这个提问的标题不好起)8. phpadmin的数据库,可以设置自动变化时间的变量吗?就是不需要接收时间数据,自动变化9. javascript - tab切换点击不同的按钮显示不同的内容10. html - css导航栏模糊,导航栏固定,随着页面滑动对下方页面产生模糊效果,如何实现?

网公网安备