Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7569401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:09:26+00:00 2026-05-30T15:09:26+00:00

I’m trying to show some user info in a listview in jquery mobile. I’m

  • 0

I’m trying to show some user info in a listview in jquery mobile. I’m also using .NET MVC 3

So in my view I have the following:

<ul class="ui-listview" data-role="listview">
 <li>
     <a href="@Url.Action("REMOVED FOR BREVITY")">
          <h3 class="ui-li-heading">@entry.DisplayName</h3>
          <p class="ui-li-desc">@entry.JobTitle</p>
          <p class="ui-li-desc">
             <a href="mailto:@entry.EmailAddress">@entry.EmailAddress</a>
          </p>
     </a>
 </li>
</ul>

All of the formatting is correct except for the mailto link.

It has the following problems

  • Link is pushed all the way to the bottom-left corner of the listview item.
  • It introduces a gap between the list view items that is not there when the link is removed.

I’ve looked at the results in firebug and I found that the resulting html sticks the inner tag outside of the parent.

So in other words the resulting HTML looks like this:

<a class="ui-link-inherit" href="REMOVED FOR BREVITY">
   <h3 class="ui-li-heading">Display Name</h3>
   <p class="ui-li-desc">JOB TITLE</p>
</a> 
<p class="ui-li-desc">
   <a class="ui-link" href="mailto:EMAILADDRESS">EMAIL ADDRESS</a>
</p>

When I expected it to look like this:

<a class="ui-link-inherit" href="REMOVED FOR BREVITY">
   <h3 class="ui-li-heading">Display Name</h3>
   <p class="ui-li-desc">JOB TITLE </p>
   <p class="ui-li-desc">
      <a class="ui-link" href="mailto:EMAILADDRESS">EMAIL ADDRESS</a>
   </p>
</a> 

Is this the browser’s doing, or something I can workaround in JQuery Mobile?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:09:28+00:00Added an answer on May 30, 2026 at 3:09 pm

    Notice I removed the jQuery Mobile classes since jQuery Mobile will add them when it initializes the widgets. It’s also important to give the email link a data-role="button" attribute so it gets rendered as a button widget. The basic fix is to add the secondary link to a fieldcontain widget so it doesn’t get rendered as a split-button link.

        <ul data-role="listview">
         <li>
             <a href="@Url.Action("REMOVED FOR BREVITY")">
                  <h3>@entry.DisplayName</h3>
                  <p>@entry.JobTitle
                      <div data-role="fieldcontain">
                          <a data-role="button" href="mailto:@entry.EmailAddress">@entry.EmailAddress</a>
                     </div>
                 </p>
             </a>
         </li>
        </ul>
    

    Here is a demo: http://jsfiddle.net/jasper/KUgwj/

    That being said, usually when you have two actions associated with a list-item, you use a split-button-list: http://jquerymobile.com/demos/1.1.0-rc.1/docs/lists/lists-split.html

    This is an example of using split-button-lists:

        <ul data-role="listview">
         <li>
             <a href="@Url.Action("REMOVED FOR BREVITY")">
                  <h3>@entry.DisplayName</h3>
                  <p>@entry.JobTitle</p>
             </a>
             <a data-icon="gear" href="mailto:@entry.EmailAddress">@entry.EmailAddress</a>
         </li>
        </ul>
    

    Here is a demo: http://jsfiddle.net/jasper/KUgwj/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.