Angular 角度材质中带菜单的完整背景图像

Angular 角度材质中带菜单的完整背景图像,angular,angular-material,Angular,Angular Material,此示例不起作用,如何将此图像应用于全屏背景? 对于内容块背景图像工作,我无法将背景图像应用于导航 。菜单间隔符{ flex:1自动; } .bg{ 宽度:100%; 身高:100%; 背景:url('https://images.unsplash.com/photo-1497091071254-cc9b2ba7c48a?ixlib=rb-1.2.1&ixid=eyjhcbfawqiojeymdd9&auto=format&fit=crop&w=1353&q=80')无重复中心; 背景大小:10

此示例不起作用,如何将此图像应用于全屏背景? 对于内容块
背景图像
工作,我无法将
背景图像
应用于导航

。菜单间隔符{
flex:1自动;
}
.bg{
宽度:100%;
身高:100%;
背景:url('https://images.unsplash.com/photo-1497091071254-cc9b2ba7c48a?ixlib=rb-1.2.1&ixid=eyjhcbfawqiojeymdd9&auto=format&fit=crop&w=1353&q=80')无重复中心;
背景大小:100%100%;
背景位置:上中;
背景重复:无重复;
}

宠物

如果我得到了您想要的,您需要将样式添加到
.mat toolbar
类以使其工作

.mat工具栏{
背景:url('https://images.unsplash.com/photo-1497091071254-cc9b2ba7c48a?ixlib=rb-1.2.1&ixid=eyjhcbfawqiojeymdd9&auto=format&fit=crop&w=1353&q=80')无重复中心;
背景尺寸:封面;
颜色:#fff;
}
看这个


它甚至可以工作。

如果我得到了您想要的,您需要将样式添加到
.mat toolbar
类中以使其工作

.mat工具栏{
背景:url('https://images.unsplash.com/photo-1497091071254-cc9b2ba7c48a?ixlib=rb-1.2.1&ixid=eyjhcbfawqiojeymdd9&auto=format&fit=crop&w=1353&q=80')无重复中心;
背景尺寸:封面;
颜色:#fff;
}
看这个


它甚至可以工作。

希望这会对你有所帮助。请相应更改

.bg{
  width: 100%;
  height: 100%;
  background: url('https://images.unsplash.com/photo-1497091071254-cc9b2ba7c48a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1353&q=80') no-repeat center;
  background-size: cover;
}


希望这对你有帮助。请相应更改

.bg{
  width: 100%;
  height: 100%;
  background: url('https://images.unsplash.com/photo-1497091071254-cc9b2ba7c48a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1353&q=80') no-repeat center;
  background-size: cover;
}


请删除高度:100%或更改为高度:80vh,然后重试。请确保您需要在HTML中将
插入头部请删除
高度:100%
或更改为
高度:80vh
,然后重试。请确保您需要将
以html格式输入头部