• Resolved Diomedes

    (@diomedes)


    I’m trying to make the first line of each post (in my blog) automatically small-caps.

    I tried the code below, but it turns the first line of every paragraph into small-caps instead of just the first line. Is there a way to specify?

    p:first-line {
    font-variant:small-caps;
    }

    What I’m looking for is pretty much like what’s built into the Oulipo theme (except that it works in a post with images also) so I tried stealing the code from there, cleaned it up to the best of my rather poor ability, and came up with this code –

    .entry > p:first-child:first-line {
     ont-variant:small-caps
    	font-family: Georgia, "Times New Roman", Times, serif;
    }

    – which doesn’t work. Help?

Viewing 5 replies - 16 through 20 (of 20 total)
  • @diomedes, I tested it on a simple file and it worked fine. Do you have it set up on your site?

    Thread Starter Diomedes

    (@diomedes)

    I inserted the code you specified and wrapped the first paragraph with —

    <p class="smallcaps">

    — and closed it with a simple paragraph class.

    This is how it looks like.

    ha ha ha – -that’s because your old CSS is still in the file too — and we happened to use the same class — so remove this one:

    .smallcaps {
        font-size: 14px;
        font-variant: small-caps;
    }

    Thread Starter Diomedes

    (@diomedes)

    GOOD GOLLY IT WORKED!!! 😀

    Phew. Thanks so much for the great help! Appreciate it a whole lot.

    No problem — glad we got it sorted — so satisfying too, I agree!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘First line in small-caps?’ is closed to new replies.