您的位置:首頁技術文章
文章詳情頁

php 加載的文件 css js返回給html沒有效果是什么問題呢?

瀏覽:121日期:2024-04-14 08:47:03

問題描述

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 并讀取返回內容。

實際樣式沒有應用成功

php 加載的文件 css js返回給html沒有效果是什么問題呢?

php 加載的文件 css js返回給html沒有效果是什么問題呢?

這是為什么呢?跪求高手解答

問題解答

回答1:

html{font-size:100px} 換成 p呢?

標簽: HTML
相關文章:
国产综合久久一区二区三区