The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Auto style for first sentence of post

  • # July 27, 2009 at 11:53 am

    I know there’s CSS for the first letter of a post (magazine style, etc.), but wasn’t there also a way to make (for example) the first sentence bold, or a different colour?

    I’m going to Google it myself, I’d just said I’d post it here should anyone else have the same idea… If I find anything I’ll post.

    # July 27, 2009 at 12:01 pm

    Heh – first result on Google brought up another forum where the response to a user was:

    You have two choices; you can either add an element around the first sentance using either Javascript or a server side language when used in conjunction with regex. Then the element that’s been created can by styled with CSS.

    Fair enough. If I don’t want to use spans I have to use Javascript. Any idea’s there?

    @admin – move to Javascript forum if you want.

    # July 27, 2009 at 12:41 pm

    This reply has been reported for inappropriate content.

    You can do the first letter or the first line, but yeah, actually finding the full stop (period) where the first sentence ends is beyond the scope of css.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed