treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Line-height not working inside span

  • span.aidanews2_text{
     font-size:13px;
    font-family:arial; 
    line-height:12px;       
    
        }
    
    <span class="aidanews2_text">
    PEKIN --  China inaugura el, miércoles la línea de ferrocarril de alta velocidad...</span>
    

    Line height doesn't work... I even try doing line-height:8px for testing purposes but, noticed it doesn't work inside that span block. I don't know if it needs a p tag but, I don't have control over that piece of code because is coming from a joomla extension.

    How can I fix the line height in this situation... Thanks in advanced for your time and help.

  • Three options: 1) use a div instead of a span, 2) add "display: block" to force it to act like a block element, or 3) add "display: inline-block" to make it act like an block element while continuing to flow inline alongside its sibling text (assuming there is sibling text).

  • I was able to edit the extension code and added a p tag between span... That worked.

    Thanks TreeRoot

  • Use inline-block if you want it on the same line