Forums

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

Home Forums CSS Random padding on top and bottom of the code elements

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #41281

    Hey everyone! I’m experiencing a problem with my [blog](http://mattkosloski.tumblr.com/post/36558501423/css-slider “blog”). For the <code> inside of the <pre> boxes, there seems to be random padding on the top and on the bottom of it. Below is a url to a screenshot that climaxes my problem. Notice there’s no padding on the right side, a little padding on the left, and a lot of padding on the top and bottom.

    http://d.pr/i/bm5i

    #116930
    twincy
    Participant

    now that is weird. the reset doesn’t add anything to it.

    #116931
    twincy
    Participant

    hmmm. u have a line-height that might be the issue:


    code {
    font-family: 'Inconsolata';
    line-height: 20px;
    }
    #116932

    @twincy , There’s still padding on the sides. :( Thank you for you help though! Very appreciated.

    #116933
    wolfcry911
    Participant

    It’s the spaces, tabs, and line returns in your code

    #116957
    _dte
    Member

    wolfcry is right, it’s a line return causing that issue. So instead of writing your HTML like this:

    Whatever

    You should write it like this:

    Whatever

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