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
  • #171883

    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">
        <meta charset="utf-8">
        <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;
      text-align: center;
                <a href="#">Top line<br>Bottom line</a>
            </div> </div> </div>
    </div><!-- end navigation -->
    </div> <!-- end page -->

    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.