html - 需要背景图像覆盖另一个背景图像

标签 html css background

到目前为止我还没有成功解决这个问题,所以我需要帮助。我想要做的是让背景图像适合平板电脑。在里面我有一张 table ,还有一个右上角的标志,但现在我想在背景上有一个透明的标志,只有屏幕的一半..标志是一只鹰,但我只想要一半它在背景上。老鹰必须在背景之上(透明),但也要在 table 后面……想法?建议?代码明智?

最基本的是,在另一个背景图像(透明)上放置一个背景图像,并且只覆盖屏幕的一半。

谢谢

body { width: 100%; height:100%; display: -webkit-box; display: -moz-box; display: box; text-align:center;

background:url(1xx.png);
-webkit-background-size: cover !important;
-moz-background-size: cover;
background-size: cover;
font-family: Arial, Times New Roman, sans-serif;
font-size: 20px; 
z-index:0; }  body{   display: table;     width: 100%;    } .box {
width: 75%;
height:90%;

margin-left:auto;
margin-right: auto;
margin-top:auto;
margin-bottom: auto;
 }

最佳答案

有两种选择,要么使用CSS3多重背景:

background-image: url(eagle.png), url(background-image.png);
background-position: left top, center top;
background-repeat: no-repeat;

或使用 position:Absolute;

将老鹰定位在背景上

关于html - 需要背景图像覆盖另一个背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18152912/

相关文章:

html - 具有左右内容框的CSS

html - 为属于 span 标签的不同类设置样式

ios - 创建具有可调整大小的自定义背景的 texview

html - 带 child 的容器的高度

html - 更改超链接和段落文本的颜色

html - 在标签前添加复选框

html - 仅使用 CSS 的砌体式布局

javascript - 在网站上创建幻灯片

iOS 上出现的 CSS 背景线

javascript - Bootstrap DropDown需要属性值