如何正确放置区域?
大家好,任何时间都可以问我!
请问有经验的人能告诉我缺少哪些CSS代码吗?
我想在主题中添加两个区域。User bar 1st 和 2nd。但我无法将它们放在同一行,并且使用margin auto对齐或居中。
Drupal 7。
在page.tpl.php中的代码如下:
<div class="zone-user-wrapper">
<div id='userbarfirst'>
<?php if ($page['user_first']): ?>
<?php print render($page['user_first']); ?></div>
<?php endif; ?>
<div id='userbarsecond'>
<?php if ($page['user_second']): ?>
<?php print render($page['user_second']); ?></div>
<?php endif; ?>
</div>
以下是CSS样式(目前的样子,我已经尝试过添加和删除,但没有成功。只能用float left或right,但这不合适):
.zone-user-wrapper {
margin-top: -5em;
z-index: 200;
display: block;
clear: none;
}
.zone-user-wrapper {
background-color: #00779C;
height: 3em;
min-width: 650px !important;
width: 100%;
}
#userbarfirst {
float: right;
height: 38px;
margin-right: 2.5em;
margin-top: 0;
padding-right: 0;
position: relative;
width: 377px;
display: block;
margin-left: auto;
margin-right: auto;
}
#userbarsecond {
float: right;
height: 35px;
margin-top: 0;
position: inherit;
width: auto;
margin-right: 1px;
display: block;
margin-left: auto;
margin-right: auto;
}
非常感谢任何帮助!