How to include all css kept in a directory?

后端 未结 8 2027
情歌与酒
情歌与酒 2020-12-03 10:20

Is it possible to include multiple css at once in html? Or to be precise, is it possible to include all css placed in a directory, in one go?
like at present what we d

8条回答
  •  抹茶落季
    2020-12-03 10:57

    you could use php to list all file with css extension in that directory...

    $fp = opendir($dir);
    while ($file = readdir($fp)) {
            if (strpos($file, '.css',1))
                $results[] = $file;
        }
    closedir($fp);
    

    ...and than do a foreach construct to incude css's

提交回复
热议问题