将div元素放在响应式背景上(Bootstrap 3) [英] Place div elements on responsive background (Bootstrap 3)

查看:105
本文介绍了将div元素放在响应式背景上(Bootstrap 3)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将div(输入表单)放在响应的背景上.

I would like to place div's (input form) on a responsive background.

我正在使用Bootstrap 3作为页面模板.但是,如果我调整窗口大小或使用其他屏幕尺寸,则元素位于另一个位置.我该如何解决这个常见问题?

I'm using Bootstrap 3 for the page template. But if I resize the window or use another screen size the elements are on another place. How could I fix this common issue?

示例: http://goo.gl/D7TwIP

谢谢!

推荐答案

不是使用margin-top和margin-left而是在定位的绝对元素上使用top和left属性.

Instead of using margin-top and margin-left use top and left properties on a positioned absolute element.

top: 540px;
left: 117px;
position: absolute;

还要确保将父元素设置为相对位置.

Also make sure the parent element is set to position relative.

position: relative;

这篇关于将div元素放在响应式背景上(Bootstrap 3)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆