为什么div标签不能作为包装块?

时间:2017-01-28 03:05:31

标签: html css

我用来制作卡片。然而,似乎根本没有提供任何边界,因此整个页面具有正文的背景颜色。我试图修补,改变它的位置,但它不起作用。为什么是这样?以下是我的代码。

UILongPressGestureRecognizer

这是我的CSS:

UILongPressGestureRecognizers

1 个答案:

答案 0 :(得分:1)

默认情况下,对象没有background-color属性(默认为透明)。如果您希望提供透明background-color之外的其他内容,则需要对其进行定义。

最简单的方法是在.card类定义中设置以下属性:

background-color: white;

background: white; /* This allows for more attributes */