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" > <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. javascript - 微信網頁開發從菜單進入頁面后,按返回鍵沒有關閉瀏覽器而是刷新當前頁面,求解決?2. mysql replace 死鎖3. android - 安卓做前端,PHP做后臺服務器 有什么需要注意的?4. mysql - ubuntu開啟3306端口失敗,有什么辦法可以解決?5. 求救一下,用新版的phpstudy,數據庫過段時間會消失是什么情況?6. extra沒有加載出來7. python3.x - Python not 運算符的問題8. python - 數據與循環次數對應不上9. mysql - C#連接數據庫時一直這一句出問題int i = cmd.ExecuteNonQuery();10. python小白,關于函數問題
