Problem with line height when using <span> and "float:right"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luftikus143
    New Member
    • Jan 2007
    • 97

    Problem with line height when using <span> and "float:right"

    Hi there,

    I am building a small WebApp, and using a list to display country values for a specific variable. It should be like

    Country A 10
    Country B 4
    Country C 125


    So, what I have in CSS is this:
    Code:
    .variable {
    	font-size: 12px; 
    	font-weight: bold;
    	color: #7388a5;
    }
    
    .value {
    	font-size: 12px; 
    	text-align: right;
    	float: right;
    }
    and the code like this:
    Code:
    <ul>
      <li>
        <span class="variable">Afghanistan</span>
        <span class="value">10</span>
      </li>
    </ul>
    But, when using a 1px border around the SPANs, I see that the "variable" box is a big as the name, but the "value" boxes are taller, as if there would be a BR attached to the SPAN.

    What is this, and how can I solve this?

    Thanks for any hints!
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    I don't see this problem at all. Which browser are you using?

    Comment

    • luftikus143
      New Member
      • Jan 2007
      • 97

      #3
      Ok, I stripped off all CSS code which was included in DIVs before, and started from scratch. Now it works again. Problem was related with parent-CSS.

      Cheers!

      Comment

      Working...