0

Here's a JsFiddle :

HTML :

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div data-role="page" data-theme="b" id="home">
    <div class="wrapper">
        <div data-role="tabs">
                <div data-role="navbar">
                    <ul>
                        <li><a href="#fragment-1" class="ui-btn-active">test 1</a></li>
                        <li><a href="#fragment-2"> test 2</a></li>
                    </ul>
                </div>
                <div id="fragment-1">
                    test1
                </div>

                <div id="fragment-2">
                    test2
                 </div>
        </div>     
    </div>
</div>

CSS :

.wrapper {
    margin: 0 auto;
    max-width: 600px;
    font-size: 12pt;
}

It's working fine on JsFiddle. But in my page, it it like this :

enter image description here

instead of :

enter image description here

Do you have an idea what could be the problem ?

It's ASP.NET MVC website. My Layout :

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        @Styles.Render("~/Content/css")
    </head>
    <body>
        @RenderBody()
        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/jquerymobile")
        @RenderSection("scripts", required: false)
    </body>
</html>

I have no problem with JQuery Mobile in my other pages...

1 Answer 1

1

Yes, you need to remove the margin and the list-style of the ul:

[data-role="navbar"] ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you!. Is this a normal behavior ? And I still have a space between the two tabs. Do you know how can I display it like on JsFiddle ?
Yes, by default, uls are indented and bulleted. As for the space, try to clear the margin and padding of [data-role="navbar"] ul li
Thank you. In fact the second problem was stupid. I set a max-width for ui-btn in my css...

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.