我很难设计这个样式。我只希望徽标和搜索栏居中,在上方和下方留出更多空间来填充页面。 (这是在NE1UP点com上)

这只是一个Google风格的页面,这就是我想要的,但是我很难让这个徽标和搜索栏对齐并正确显示,就像Google页面一样。我不确定这在视觉上是否是最好的选择,但这就是我现在可以想象的,只是想弄清楚我在做什么错。

谢谢你的帮助!

这是来自index.htm的代码

<div class="row">

            <div class="span12">
            <img src="soos.png" width="208px" height="72px">
            <div class="span2">
            </div>
            <div class="span8">

               <form action="search.php" method="get">




<input id="name" style="width:90%;height:50px;margin-top:0px" type="text" name="q" class="input-xxlarge" id="q" placeholder="Enter Search Term Here"/>



     搜索
   





以及来自main.css的代码:

.span8 input {display: block; margin-left: auto; margin-right: auto;}


.span8按钮{margin-left:4.8%}

最佳答案

我不知道引导方式,但是如果您坚持使用传统CSS,则可以使用position: absolute;

.logo {
   position: absolute;
   left: 50%;
   top: 50%;
   width: 300px;
   height: 100px;
   margin-top: -50px; /* Half of total height */
   margin-left: -150px; /* Half of total width */

}

10-06 14:09
查看更多