居中我的搜索框

Center My Search Box

我正在尝试将我的搜索框对齐以始终位于我的 WordPress 页面的页面中心。

你可以在 http://dev.replacementdustcollectorfilter.com/ 看到我在说什么。

我把 box 输入框放在它自己的 div & class <div class="search-form-box">,但我不确定下一步该做什么。

margin: 0 auto; 添加到您的 #search div。这将分配 auto 的左右边距,这将使 div.

居中

参见this answer and the docs at w3