PHP code
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 content
html{ font-size: 100px; }
html content
自动换行 <!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 Yes Load the css file like this:
http://127.0.0.1/res/public/css/style.css
Disassemble/res/public/css/style.css
/res/ Module
Get the real path www\app\public\res\css\style.css and read the returned content.
The actual style was not applied successfully
##Why is this? Woolen cloth? I beg the experts for answers
html{font-size:100px} What about replacing it with p?