html - CSS Floating and inline spans -
i'm trying achieve following:
i'm using float:left
have span containing user name floating right of big numbers left.
this have far: https://jsfiddle.net/d00ck/twcmfzo8/2/
body { font-family: arial; } .container { background-color: white; padding-bottom: 15px width: 360px; } .position { clear: both; margin: 10px 0 10px 0; padding: 0 10px 0 10px; width: 100%; } .ranking-position { font-size: 25px; float: left; } .ranking-tier { display: block; } .ranking-score { clear: both; }
<div class="container"> <div class="position"> <span class="ranking-position">1</span> <span class="ranking-name">dorothy bradley</span> <span class="ranking-tier">1rs team all...</span> <span class="ranking-score">1000pts</span> </div> <div class="position"> <span class="ranking-position">1</span> <span class="ranking-name">user name</span> <span class="ranking-tier">1rs team all...</span> <span class="ranking-score">1000pts</span> </div> <div class="position"> <span class="ranking-position">1</span> <span class="ranking-name">user name</span> <span class="ranking-tier">1rs team all...</span> <span class="ranking-score">1000pts</span> </div> </div>
i'm missing important since can't seem make span containing "1000pts" legend float right of big number. appreciated.
you need change
.ranking-tier { display: block; }
to this:
.ranking-name { display: block; }
something this:
html:
<div class="container"> <div class="position"> <span class="ranking-position">1</span> <span class="ranking-name">dorothy bradley</span> <span class="ranking-tier">1rs team all...</span> <span class="ranking-score">1000pts</span> </div> <div class="position"> <span class="ranking-position">1</span> <span class="ranking-name">user name</span> <span class="ranking-tier">1rs team all...</span> <span class="ranking-score">1000pts</span> </div> <div class="position"> <span class="ranking-position">1</span> <span class="ranking-name">user name</span> <span class="ranking-tier">1rs team all...</span> <span class="ranking-score">1000pts</span> </div> </div>
css:
body { font-family: arial; } .container{ background-color: white; padding-bottom: 15px width: 360px; } .position { clear: both; margin: 10px 0 10px 0; padding: 0 10px 0 10px; width: 100%; } .ranking-position { font-size: 25px; float: left; } .ranking-score { clear: both; } .ranking-name { display:block; }
Comments
Post a Comment