Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] line-height problem.

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #171883
    lkeeney
    Participant

    I have the following code, but I can’t figure out how to reduce the line height between the two lines in the box. I have the line-height set to 0px. I can make the spacing more, but not less.

    Link to website.

    Can anyone help me on this problem?

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Navigation</title>
        <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
        <link rel="stylesheet" media="(max-width: 1024px)" href="css/reset.css">
        <link rel="stylesheet" media="(max-width: 1024px)" href="css/1024frames.css">
    <style type="text/css">
    a {
      position: relative;
      top: -5px;
      text-decoration: none;
      color: black;
      line-height: 0px;
    }
    
    #frame1{
      text-align: center;
    }
    </style>
    
    </head>
    <body>
    <div>
    
    <div>
    <div>
        <div>
            <div>
                <a href="#">Top line<br>Bottom line</a>
            </div> </div> </div>
    </div><!-- end navigation -->
    
    </div> <!-- end page -->
    </body>
    </html>
    
    #171890
    lkeeney
    Participant

    Thank you, thank you.

    I used display:inline-block and it works perfectly.

    How did you know this would fix my problem?
    I spent all afternoon reading posts on the internet concerning line spacing less than the font height, and I never saw a single mention of “display”.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.