我在父div中有三个div,它们使用以下方式间隔开:
display: flex;
justify-content: space-between;
Run Code Online (Sandbox Code Playgroud)
但是,父div有一个:after
on,它使得三个div不会出现在父div的边缘.有没有办法让flexbox忽略:before
和:after
?
.container {
width: 100%;
display: flex;
justify-content: space-between;
padding-top: 50px;
background: gray;
}
.container div {
background: red;
height: 245px;
width: 300px;
}
.container:before {
content: '';
display: table;
}
.container:after {
clear: both;
content: '';
display: table;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
<div></div>
<div></div>
<div></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我有这个功能
result =
add 1 2 |> \a -> a % 2 == 0)
Run Code Online (Sandbox Code Playgroud)
我收到这个错误
Elm does not use (%) as the remainder operator
Run Code Online (Sandbox Code Playgroud)
当我查看文档时,我发现我可以使用modBy
,所以我尝试了这个。
Elm does not use (%) as the remainder operator
Run Code Online (Sandbox Code Playgroud)
但这给了我以下错误。
This function cannot handle the argument sent through the (|>) pipe:
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Elm 19 将布尔结果打印到屏幕上。
result =
add 1 2 |> (\a -> modBy 2 a == 0)
main =
Html.text (String.fromBool result)
Run Code Online (Sandbox Code Playgroud)
我知道当方程吐出 Int 时 fromInt 可以工作,但我不知道如何将 bool 转换为 String 来解决我当前的问题。