2014-05-17 147 views
-2

在不同的分辨率下,搜索输入只是左右移动一点,而我无法修复。CSS不同的分辨率

<div id="container" style="margin:0 auto; max-height:100%; "> 
    <nav id="nav" style="margin:0 auto; background-color:#2d3e46; position:fixed; width:100%; height:77px; overflow:hidden;"> 
     <div class="logo" style="background-image:url('images/arti.png'); width:68px; height:40px; margin-top:1.1%; margin-left:6%;"></div> 
     <form method="POST" style="margin-top:-2.4%"> 
      <input type="text" class="search" style="position:relative; background-color:white;width:207px; height:30px; border-radius:2px; text-indent:4px; margin-left:25%;" /> 
      <br /> 
     </form> 
    </nav> 
</div> 

回答

0

.logo元素具有基于%的边距,因此它总是会在不同的分辨率下发生变化。

0

由于约瑟说 一些元素具有基于%的边距,并且作为结果,当在不同分辨率下查看时,它们将移动,试图给它们一个固定的边缘,fx,10px。