html - Creating a JQuery Mobile style list view (without JQM) -


i'm trying make list view looks similar list in link below (but not using jqm). http://view.jquerymobile.com/1.3.1/dist/demos/widgets/listviews/#list-formatted

after experimenting various methods on past few days (including bad attempt @ duplicating jqm properties), have:

http://jsfiddle.net/gnnn2/

there still number of problems though:

  • li border-bottom appears on top instead of bottom
  • at small width, dot overlaps text instead of showing ellipses
  • the dot (arrow) not vertically centered

here html:

<ul>   <li>     <a href="#">       <div>         <span class="label">richard f. godwin</span><br/>         <span class="subtext">direct research representative</span><br/>         <span class="subtext">ann arbor, mi</span>       </div>       <img class="icon"></img>     </a>   </li> </ul> 

and css:

body {     margin: 0;     padding: 0; } ul {     list-style-type: none;     margin: 0px;     padding: 0px;     width: 100%;     float: left;     overflow: hidden; } ul li {     clear: both;     margin: 0px;     padding: 0px;     background-color: #ffffff;     border-bottom: 1px solid #bbb;  /* appears @ top instead of bottom */ } ul li {     padding: 15px 20px;     margin: 0px;     width: 100%;     float: left; } ul li div {     margin: 0;     padding: 0px;     width: 80%;     float: left;     display: block; } ul li div span.label {     font-size: 15px;     font-weight: normal;     white-space: nowrap;     text-overflow: ellipsis; } ul li div span.subtext {     margin-left: 10px;     color: #067ab4;     font-size: 14px;     font-weight: normal;     white-space: nowrap;     text-overflow: ellipsis;    /* overlaps instead of showing ellipses on short widths */ } ul li img {     height: 18px;     width: 18px;     background-color: rgba(0, 0, 0, .4);     -webkit_border-radius: 9px;     border-radius: 9px;     display: block;     background-repeat: no-repeat;     float: right;     position: relative;     margin-top: 11px;        /* not centered correctly when li has different height */     right: 35px;     display: block;     vertical-align: middle; } 

css positioning & styling new me. appreciated.

well, think i've done pretty wht they've done @ jquery. center image made background. , fix borders added overflow:hidden; that's pretty it.

here's fiddle: http://jsfiddle.net/gnnn2/4/


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -