2012-11-01 67 views
0

我在标题中有一个图像,当我将<img>包装在<a>标记中时,图像被移位。我假设<a>标记具有导致此问题的默认边距或填充。如何删除jQuery-Mobile中<a>标签的默认边距或填充?调整默认边距

<div data-role="header" data-position="fixed" class="shadow"> 
     <a href="#CheckInPage" data-role="none" id="newheader"> 
      <img id="goHeaderLogo" src="images/go.gif" alt="go Logo"/> 
     </a> 
     <h2>Locations Near Me</h2> 
</div> 

我尝试这样做:

<script> 
     $('#newheader').css("margin",'0px'); 
    </script> 
+0

jquery mobile做了很多改变你的代码包装它在几个容器。所以,首先,看看如何封装你的图像,并使用jsfiddle向我们演示一个演示。 –

回答

1

找出你需要修改的风格最好的办法是检查的东西,如萤火虫或浏览器的开发者工具的各个元素

试试这个(我用margin-left: 50px看比较好)

<style> 
    .ui-header .ui-btn-left { 
    margin-left: 50px; 
    } 
</style> 

你得到这个
enter image description here