1

In my experience, having a <ul> right above or below a button <a data-role="button">..</a> causes them to overlap. My workaround is to generously use <br>'s, but this seems like a broken workflow.

Does anyone know a fix to this overlap issue?

Here's a JsFiddle demonstrating my problem.

Here is the code used in the fiddle:

    <div data-role="content">
        <ul data-role="listview" data-theme="b">
            <li>Hello</li>
            <li>World</li>
        </ul>
        <a data-role="button" href="#">Give me my space!</a>

        <ul data-role="listview" data-theme="b">
            <li>Boring</li>
            <li>workaround</li>
        </ul>
        <BR>
        <a data-role="button" href="#">Give me my space!</a>
    </div>

Update: I played around a bit more, and making the listview inset fixed the overlap. Nonetheless, I would like a way to avoid overlapping without inset if anyone knows how! New JsFiddle

1 Answer 1

1

It looks like an incorrect margin override in jQuery Mobile's CSS.

You can work around it by specifying:

.ui-content .ui-listview, .ui-panel-inner .ui-listview {
    margin-bottom: 1em;
}

However, this may conflict with other jQuery Mobile widgets (unless the margin override is a bug to begin with).

You can see the results in this updated fiddle.

Sign up to request clarification or add additional context in comments.

1 Comment

Nice! I'll use this and keep my eye out for any side effects on other widgets

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.