Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.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/34.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 为什么背景图像不能正确放入引导流体容器中?_Html_Css_Twitter Bootstrap 3_Bootstrap 4 - Fatal编程技术网

Html 为什么背景图像不能正确放入引导流体容器中?

Html 为什么背景图像不能正确放入引导流体容器中?,html,css,twitter-bootstrap-3,bootstrap-4,Html,Css,Twitter Bootstrap 3,Bootstrap 4,背景图像仅显示在前两列中,而不显示在整个容器的背景中。我使用了以下代码: <div class="container-fluid bg"> <div class="row"> <div class="col-md-4 col-sm-6 col-xs-12"> </div> <div class="col-md-4 col-sm-6 col-xs-1

背景图像仅显示在前两列中,而不显示在整个容器的背景中。我使用了以下代码:

    <div class="container-fluid bg">
        <div class="row">
            <div class="col-md-4 col-sm-6 col-xs-12">
            </div>
            <div class="col-md-4 col-sm-6 col-xs-12">
                <form class="form-container">
                    <div class="form-group">
                        <label for="exampleInputEmail1">Email address</label>
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
                    </div>
                    <div class="form-group">
                        <label for="exampleInputPassword1">Password</label>
                        <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
                    </div>

                    <button type="submit" class="btn btn-default">Submit</button>
                </form> 
            </div>
            <div class="col-md-4 col-sm-6 col-xs-12">
            </div>
        </div>
    </div>
and css file is:

    .bg{
    background: url('bg.jpg');
    height: 100%;
    width: 100%;
    background-repeat: no-repeat;   
}
.form-container{
    border: 1px solid;
}

删除背景重复:不重复;并在正文和html上添加100%高度

html, 身体{ 身高:100%; } .bg{ 背景:url'https://picsum.photos/100/100'; 身高:100%; 宽度:100%; } .表格容器{ 边框:1px实心; } 电子邮件地址 暗语 提交 包括

.bg{ 背景图片:url'https://via.placeholder.com/200x200'; 背景尺寸:封面; 身高:100%; 宽度:100%; 背景重复:无重复; } .表格容器{ 边框:1px实心; } 电子邮件地址 暗语 提交 使用背景重复:不重复;背景尺寸:封面

引导示例 正文,html{ 身高:100%; 保证金:0; } .bg{ /*使用的图像*/ 背景图像:urlhttps://www.w3schools.com/howto/img_parallax.jpg; /*全高*/ 身高:100%; /*将图像居中并精确缩放*/ 背景位置:中心; 背景重复:无重复; 背景尺寸:封面; } 电子邮件地址 暗语 提交
请发布你的html。告诉我解决方案,现在我也发布了html。删除背景重复:无重复;我已经删除了它现在它确实适合,但它没有显示在整个窗口上只有提交按钮请检查我的回答它工作。非常感谢。@MuhammadFiaz谢谢,如果这个答案对你有用,请接受它它帮助未来的读者找到有效的答案