首页 > 解决方案 > 如何在 PUG 模板引擎的媒体查询中包含 CSS 文件?

问题描述

我可以css在文件的媒体查询中包含index.pug文件吗?我试过这样

style
   <link rel="stylesheet" media="screen and (max-width: 1170px)" href="../static/respnsive.css">

但什么也没发生。有没有其他方法可以做到这一点并使网页响应?

标签: htmlcssnode.jspug

解决方案


meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
title CodeXpool
link(rel='stylesheet' media='only screen and (max-device-width: 881px)' href='../static/style2.css')

推荐阅读