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 8457505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:49:31+00:00 2026-06-10T12:49:31+00:00

I am having an issue with line-height on a list item. In a nutshell,

  • 0

I am having an issue with line-height on a list item.

In a nutshell, we have a line-height assigned to the body, which the <li> obviously inherits.

If I put a <span> inside the list item and specify a font-size that’s smaller than the standard body font, the <li> keeps the line-height for the document, not for what the span actually is using.

One thing to consider is that I’m very limited with what I can do with regards to the actual HTML, as this is HTML created by the ckeditor (wysiwyg) editor. If you open that editor, create some list items and then change the font size, this is what you get:

<ul>
    <li><span style='font-size:8px'>Item 2 -- and some supporting text</span>
    <li><span style='font-size:8px'>Item 2 -- and some supporting text</span>
    <li><span style='font-size:8px'>Item 2 -- and some supporting text</span>
</ul>​

I can’t really change what it outputs, but of course we can try and use CSS rules to control it.

I put up a jsfiddle that illustrates the issue: http://jsfiddle.net/virtualpromote/pW47c/

If you know of a way to make the <li> to base its line-height on the height of the <span> within it, that would be awesome.

— Javascipt is not an option to solve this problem. The HTML that’s generated is actually passed onto an app that creates a PDF out of it on the fly, so that of course, can’t parse any javascript rules that we could apply after the fact.

  • 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-06-10T12:49:32+00:00Added an answer on June 10, 2026 at 12:49 pm

    John,

    Billy Moat has the right idea, something like this will work:

    li span { line-height: 10px; display:block; }​
    

    The span tag falls inline with its container element, the li. Changing it to block forces it outside of inline elements, thus not inside the li line-height.

    Cheers

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

Sidebar

Related Questions

I am having a weird issue with nuget.exe command line tool. I have a
I am having an issue with line-height that I cannot quite get my head
I'm having a strange issue. I have a dynamically created 2D array, Content, which
I am having an issue with a pstn line connecting to a modem. The
Hi guys I am having issue I have this query: SELECT * FROM useraccount
Just started mongo and started having issue with querying already. i have a collection
Having an issue resizing the #main_wrap on: http://www.coffeeproteindrink.com/method-athlete/ #main_wrap { min-height: 100%; background: url(images/content_back.png)
I am having an issue I have yet to see elsewhere using the image
I am using WinDBG 6.12.0002.633 X86. I'm having an issue with the command-line debugger
I'm currently having problems with Internet Explorer 8 ignoring padding/line-heights that I have on

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.