【发布时间】:2012-07-10 00:14:33
【问题描述】:
我正在使用基于 twitter bootstrap 的响应式 wordpress 主题。由于某种原因,侧边栏图像未正确调整大小。 (您可以通过查看 [site][1] 并尝试调整大小来了解我的意思。)我通过向小部件声明一个固定大小来解决此问题,然后使用绝对相对定位将表单定位在其中。当您在桌面上时,图像/联系表单看起来不错,但是当您压缩布局(例如在 iphone 上)时,联系表单和图像无法正确调整大小。我不知道从这里去哪里,有点卡住了。
这是我现在使用的 css(可能不正确。)谢谢!
.widget .signupForm {
/* Box always has colour, pic always on right */
background-color: #06d0d2;
background-image: url(http://noahsdad.com/wp-content/uploads/2012/05/noahs-dad-side-bar.jpg);
background-position: right bottom;
background-repeat: no-repeat;
/* height ensures full pic is shown */
height: 300px;
/* allow us to position contents */
position: relative;
}
/* Absolutely position the form within the widget */
.widget .signupForm form {
position: absolute;
right: 160px;
bottom: 0px;
}
.widget .signupForm form input {
display: block;
}
@media screen and (min-width: 768px) {
/* now just resize the widget box and move the form */
.widget .signupForm {
width: 300px;
height: 240px;
background-size: 100%;
}
.widget .signupForm form {
right: 120px;
bottom: 0px;
}
【问题讨论】:
-
您希望您的侧边栏保留为侧边栏吗?现在,它位于内容下方。您对调整大小的预期结果是什么?
-
没有。我希望正确调整大小。例如,当第一个图像低于内容区域时,它不会保持正确调整大小。它从正方形变成了长方形。
-
@VivekChandra 只是想跟进看看您对此是否有任何其他想法。谢谢。
标签: css wordpress twitter-bootstrap responsive-design