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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:01:00+00:00 2026-05-29T05:01:00+00:00

I got a CSS question related to this fiddle: http://jsfiddle.net/r584e/ Here the relevant screenshot

  • 0

I got a CSS question related to this fiddle: http://jsfiddle.net/r584e/
Here the relevant screenshot

line height: 1em (left) and 0.8em (right)

Sometimes I’ve got to style an inline element in a such way, trying to almost avoid space between rows and applying a background only under the text. As you can see, the first paragraph has a link inside, in which I set line-height: 1em . The paragraph on the right has instead a line-height: 0.8em;. (Note: I know in this way I could roughly cut some letters – like q,g,p,… but the text is uppercase so it’s not really a problem)

In the second paragraph rows are actually closer (as I want) but unfortunately each row is also partially overlapping the previous one (unless you remove the background color applied) and this is not good (e.g. see the word «uppercase» on the bottom), so here my questions:

  1. how can I get the rows closer (like paragraph on the right) without them overlapping each other and defining a background color (no matter the element in which it is applied but it has to stay under the text, not fill a whole block)
  2. Optionally there is a way to add an horizontal padding to each line of text?

Feel free to change the CSS and/or markup. I’m looking for a pure CSS workaround.
An optimal solution should work on modern browser and, if possible, at least from IE8+

Thank you in advance. =)

Edit:
About 2nd question, using @thirtydot solution I can add space (to the right) using white-space: pre-wrap applied on the span element

  • 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-05-29T05:01:02+00:00Added an answer on May 29, 2026 at 5:01 am

    Simply add a wrapper element inside the em, such as a span, and apply position: relative.

    See: http://jsbin.com/axefaf

    <a href="#"><em style="line-height: 0.8em">
        <span>This is an uppercase multirow text inside a link element</span>
    </em></a>
    
    span {
        position: relative;
    }
    

    This works in all modern browsers and IE8, but does not work in IE7.

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

Sidebar

Related Questions

This is a CSS related question, I got one good answer from my previous
I have got this css: <style type=text/css> #heading{ margin:auto; background-color: brown; } </style> and
I got this code: <div class=class1><a href=http://nvm/>text</a></div> CSS code of class1 is following: .class1
I got a quick question about sprites in css: Will I send two HTTP
I've got a question about CSS based popup windows, like those generated by jQuery
i got this css stylesheet code #nav li ul { position: absolute; visibility: hidden;
I've got the following situation: <html> <head> <title> Title </title> <style type=text/css> #wrapper {
Good day, I've got a simple CSS question. I'm trying to change a table
I asked a question yesterday on here and got some awsome help, but I
I've got a question about creating a vertical image sprite menu. Here's my HTML:

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.