Forums

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

Home Forums CSS Body Padding and Initial Caps

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #295075
    dustnik
    Participant

    I’ve posted this twice, but it doesn’t seem to be showing up. Let’s hope this time works. I have two questions.

    1.) I tried to add a 2px padding inside all four sides of my document using the following code, but it only worked on the top and bottom. What am I doing wrong?

    .background {
    background-color: oldlace;
    padding: 2px;
    }

    2.) I made the first character in every chapter a raised initial, but the next line of text is slightly lower than it should be. I don’t understand why, as it doesn’t drop down.

    .cap {
    color: crimson;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 2.5em;
    }

    Can anyone out there help this poor newbie?

    #295076
    Paulie_D
    Member

    A demo of the issues in Codepen.io would be very helpful rather than a couple of bits of isolated CSS.

    #295077
    dustnik
    Participant

    I don’t understand what you’re asking me for. Remember, I’m new to this.

    #295094
    Paulie_D
    Member

    We can’ diagnose a problem we can’t see.

    Go to Codepen.io, add the minimum HTML & CSS to demonstrate the problem and post a link to the demo.

    https://codepen.io/pen/

    #295100
    dustnik
    Participant

    I tried doing as you asked and saved both the html and the CSS, but I don’t know how to link to it. Will it help if I give you the URL to the actual page, and you can see what I’m talking about? I’d like the text to have a little padding on the sides. The initial is about halfway down the page. You can see the extra space beneath it.

    https://archiveofourown.org/works/6479536/chapters/14832076

    #295114
    uxfed
    Participant

    Yeah that’s fine dustnik.

    1. I’m not actually seeing a problem. It’s a lot more noticeable if you bump up the amount of padding there but it’s applying all around the background element.

    2. I’d suggest using the style line-height: 1; on the style #workskin .cap

    #295116
    dustnik
    Participant

    Thank you! Thank you! Thank you! The line-height thing fixed the problem. I knew it would probably be something simple, but I didn’t have a clue what that might be.
    Both on my laptop and cell phone, the text goes all the way to the edges, although there is room on the top and bottom of the colored background. It makes the whole thing look ”cut-off” somehow. It would read so much nicer if there was a little space on the sides between the text and the edge of the body color. There is a margin surrounding the outside of the body, but I don’t think I can change that part.

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