- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我目前正在大学里做一个元素。我有一个问题,我有一张图片,我想在上面放一个盒子。它还应该根据图像的轮廓在所有边上填充。我尝试了各种方法但都失败了。谁能举一个 HTML 和 CSS 的例子来帮助我解决这个问题。
最佳答案
将图像分配给一个 div 作为背景图像,并使用 padding 将内部 div 居中。
.inner {
background-color: blue;
width: 100%;
height: 100%
}
.background {
background-image: url('http://placehold.it/800x600');
width: 100%;
background-size: cover;
height: 300px;
padding: 50px;
box-sizing: border-box;
}
关于html - 框内背景图像 HTML、CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33637653/
我正在尝试将按钮和 div 底部的一些文本对齐,就像下面的示例中的价格和 checkout 按钮一样。最好的方法是什么。我制作了一个 div,对其设置了样式以获得正确的文本和图片。我只需要将按钮附加到
将内容放置在带圆 Angular 的框 div 中以使其不会重叠的正确方法是什么? 蓝框是白框父div 里面的内容div。我希望标题位于该父框内,以便它在顶部也有圆 Angular 。 当我尝试“溢出
让 SVG 内联 HTML 文档,带有一个 View 框“x y w h”。如何检查元素是否在 View 框内? 通过说元素,它可以是组内的嵌套子路径等等...... 所以我想我正在寻找 SVG 的内
有没有办法检查鼠标是否在屏幕上的某个框内。我不知道将 jQuery 变量导出为整数以在 Javascript if 语句 中使用。我知道这可以通过 div 实现,但我不想使用 div 因为我需要很多这
目前我有两个带文本的 div 框 1 和 2,在第三个 div 框内将它们包含在一起。 Sometimes text in box 1 is longer than text inside box2
我是一名优秀的程序员,十分优秀!