如何在Bootstrap表单上放置背景图片?

问题描述:

我试图在我的表单上放置一个背景图像(就像文本和输入的后面,就像我的网站的背景图像一样),使用Bootstrap框架,但图像出现在底部,我希望它在里面容器。

I'm trying to put a background image on my form (like behind the text and inputs, just like a background image of my web site), using the Bootstrap framework but the image appears at the bottom and I want it inside the "container".

我的代码如下所示:

My code is something like this:

<div class="container">
    <div class="thumbnail">
        <form....>
            <fieldset>
            .
            .
            .
        </form>
        <img src="cs.jpg" class="img-responsive">
    </div>
<div>


您是否尝试将该容器的背景图像设置为图片? IE:

Have you tried setting the background image of that container as the image? IE:

.container {
    background-image: url("cs.jpg");
}

或者您可以直接进行:

Or you can do it inline:

<div class="container" style="background-image: url('cs.jpg');">
    ...
</div>