Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 元素不会覆盖整个屏幕,尽管高度:100%_Html_Css - Fatal编程技术网

Html 元素不会覆盖整个屏幕,尽管高度:100%

Html 元素不会覆盖整个屏幕,尽管高度:100%,html,css,Html,Css,我是一个网站,我有两个图像并排是链接到其他网页。对于这两个图像,希望它们都覆盖整个屏幕(顶部的导航栏除外)。我试着让高度:100%适合多种元素,但它没有改变任何东西 HTML: 任何建议,无论是轻微的或激烈的帮助。我是一个新手,这似乎超出了我的范围,因此我感谢您的帮助。最简单的解决方案 使用100vh .content-container img { width: 100%; height: 100vh; /* instead of 100%;*/ } #容器{ 最小高度:100%;

我是一个网站,我有两个图像并排是链接到其他网页。对于这两个图像,希望它们都覆盖整个屏幕(顶部的导航栏除外)。我试着让高度:100%适合多种元素,但它没有改变任何东西

HTML:

任何建议,无论是轻微的或激烈的帮助。我是一个新手,这似乎超出了我的范围,因此我感谢您的帮助。

最简单的解决方案 使用
100vh

.content-container img {
  width: 100%;
  height: 100vh; /* instead of 100%;*/
}
#容器{
最小高度:100%;
位置:相对位置;
}
html,
身体{
字体系列:futura;
/*身高:100%*/
保证金:0;
填充:0;
颜色:(25,28,31);
}
.内容行{
显示器:flex;
最大高度:自动;
}
.内容容器{
宽度:50%;
位置:相对位置;
}
.内容容器img{
宽度:100%;
高度:100vh;/*而不是100%*/
-webkit转换:0.75s;
-moz跃迁:0.75s;
-ms转换:0.75s;
-o-转变:0.75s;
过渡:0.75s;
}
.内容容器.中心{
位置:绝对位置;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
保证金:0;
字体大小:400%;
颜色:rgb(255、255、255);
边框底部:5px实心rgba(255,255,255,0);
-webkit过渡:边界0.75秒轻松;
-moz过渡:边界0.75秒缓解;
-ms过渡:边界0.75s缓和;
-o型过渡:边界0.75秒;
过渡:边界0.75秒缓解;
}
.内容容器:悬停img{
动画名称:变暗;
动画迭代次数:1;
动画持续时间:0.75秒;
滤光片:亮度(55%);
}
.content容器:hover.center{
边框底部:5px实心rgba(255、255、255、1);
}
@关键帧变暗{
从{
滤光片:亮度(100%);
}
到{
滤光片:亮度(55%);
}
}

车辆

#container {
min-height:100%;
position:relative;
}

html, body {
font-family:futura;
height:100%;
margin:0;
padding:0;
color:(25,28,31);
}

.content-row {
display: flex;
max-height: auto;
}

.content-container {
width: 50%;
position: relative;
}

.content-container img {
width: 100%;
height:100%;
-webkit-transition: 0.75s ;
-moz-transition: 0.75s ;
-ms-transition: 0.75s ;
-o-transition: 0.75s ;
transition: 0.75s ; 
}

.content-container .center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin: 0;
font-size: 400%;
color:rgb(255,255,255);
border-bottom: 5px solid rgba(255,255,255, 0);
-webkit-transition: border 0.75s ease;
-moz-transition: border 0.75s ease;
-ms-transition: border 0.75s ease;
-o-transition: border 0.75s ease;
transition: border 0.75s ease; 
}

.content-container:hover img {
animation-name: darken;
animation-iteration-count:1;
animation-duration: 0.75s;
filter: brightness(55%);
}

.content-container:hover .center {
border-bottom: 5px solid rgba(255,255,255, 1);
}

@keyframes darken {
from {filter: brightness(100%);}
to {filter: brightness(55%);}
}
.content-container img {
  width: 100%;
  height: 100vh; /* instead of 100%;*/
}