热门标签 | HotTags
当前位置:  开发笔记 > 前端 > 正文

使用elm-css指定CSS内容属性

如何解决《使用elm-css指定CSS内容属性》经验,为你挑选了1个好方法。

使用elm-css,我想在before伪元素中指定content属性。

我翻译了

div.boxclose{
    float:right;
    margin-top:-30px;
    margin-right:-30px;
    cursor:pointer;
    color: #fff;
    border: 1px solid #AEAEAE;
    border-radius: 30px;
    background: #605F61;
    font-size: 31px;
    font-weight: bold;
    display: inline-block;
    line-height: 0px;
    padding: 11px 3px;       
}

.boxclose:before {
    content: "×";
}

    div
        [ css
            [ float right
            , marginTop (px -30)
            , marginRight (px -30)
            , cursor pointer
            , color white
            , border3 (px 1) solid darkGrey2
            , borderRadius (px 30)
            , backgroundColor lightGrey
            , fontSize (px 31)
            , fontWeight bold
            , display inlineBlock
            , lineHeight (px 0)
            , padding2 (px 11) (px 3)
            , before [ content "×" ]
            ]
        ]
        []

但是会产生一条错误消息:该content值不是一个函数,但是给了它1个参数。

我找不到“内容”的正确功能。



1> 小智..:

您可以像这样使用elm-cssproperty功能:

css [ before [ property "content" "'x'" ]]

旁注:
content函数用于flex-basis属性。查看更多规格。 https://package.elm-lang.org/packages/rtfeldman/elm-css/latest/Css#content


推荐阅读
author-avatar
非机动车地了
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有