【问题标题】:stylus not allowing styles to take affect手写笔不允许样式生效
【发布时间】:2015-05-03 19:43:21
【问题描述】:

有人可以解释为什么会发生这种情况以及如何解决它吗?这是文件:

global-reset()

*
    box-sizing border-box
    font-size 16px
    font-family sans-serif

.header
        background #e1e1e1
        height 20em
    border-bottom 5px solid #000
    position relative

.header:before
    position absolute
        display block
        content ''
    border-bottom 5px solid red
    height 100%
        width 100%
        box-sizing border-box

.nav
    display flex
    align-items center
    justify-content flex-end
    padding-top 1em

    ul, li
        list-style none
        display inline
        margin-left 1em
        margin-right 1em

        a
            text-decoration none
            color #999

.title
    display flex
    align-items center
    justify-content center
    padding-top 2em

    h1
        padding-top 1em
        font-size 2em
        font-weight 600

.sub-title
    min-height 8em
    display flex
    align-items center
    justify-content center

    h2
        color #333

这是一个非常基本的手写笔文件,但由于某些奇怪的原因,.header 和 .header:before 部分中的底部边框样式没有生效。背景颜色和显示对齐/填充的样式都很好。

【问题讨论】:

    标签: css pug stylus


    【解决方案1】:

    我认为根据您在“评论”答案中所写的内容以及您发布的内容,您应该查看空格。用空格替换所有制表符。手写笔是基于空格的,因此同时使用制表符和空格会让你的生活变得痛苦。

    【讨论】:

      【解决方案2】:

      我使用 atom 作为文本编辑器。我似乎因为代码没有始终如一地添加标签,有些空格有些标签。我在查看我的问题中的代码时得出了这个结论。代码在文本编辑器中看起来不像那样。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-09-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多