<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body, html {
height: 100%;
width: 100%;
}
.top {
width: 800px;
margin: 0 auto;
}
.topfixedimg{
background-repeat: no-repeat;
background-size: cover;
background-image: url("image.jpg");
background-position: center;
background-attachment: fixed;
width: 100%;
height: 85%;
}
</style>
</head>
<body>
<div class="top">
<div class="topfixedimg"> </div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
如果我没有在最外面的"top"div的CSS中添加height属性,则上面的代码片段不会显示图像.
如果我添加高度,则它会正确显示图像.
它是否应该从内部div元素的CSS获取高度并仍然显示图像,即使没有最外层div元素的CSS中的height属性?
我注意到在Tinkerpop Gremlin 3.3中的一些步骤函数中使用了双下划线.有人可以告诉我们为什么我们使用这个双下划线的例子吗?我在文档中找不到关于此的足够信息.