0

I have an image in a header, and when i wrap the <img> in a <a> tag the image is displaced. I am assuming that the <a> tag has default margins or padding that is causing this. How do you remove the default margins or padding of the <a> tag in jquery-mobile?

<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>

I tried this:

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

1 に答える 1

1

変更する必要のあるスタイルを把握する最良の方法は、firebugやブラウザの開発者ツールなどを使用して個々の要素を検査することです。

これを試してみてください(以前margin-left: 50pxは違いがよくわかりました)

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

そしてあなたはこれを手に入れます
ここに画像の説明を入力してください

于 2012-11-01T15:52:25.063 に答える