【问题标题】:How can I include CSS files inside a media query in PUG template engine?如何在 PUG 模板引擎的媒体查询中包含 CSS 文件?
【发布时间】:2021-04-12 23:13:06
【问题描述】:

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

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

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

【问题讨论】:

    标签: html css node.js pug


    【解决方案1】:
    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')
    

    【讨论】:

    • 确保你已经包含了meta标签以及head标签内的css文件,并带有适当的缩进
    • 通过编辑将上述评论添加到您的答案中。谢谢
    猜你喜欢
    • 2023-03-12
    • 2019-09-10
    • 1970-01-01
    • 2018-01-21
    • 2017-02-17
    • 2013-05-07
    • 2020-10-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多