All Posts by Email, Once a Week

Media Temple logo

CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.

Selecting a classless paragraph

  • # January 26, 2013 at 11:16 pm

    Is there a way i can target a class-less or id-less tag? specifically a paragraph tag?

    # January 26, 2013 at 11:23 pm

    This reply has been reported for inappropriate content.

    Yes you should be able to. You can target a paragraph within a certain div or other element, you’ll just have to get specific in your css. Let’s say you have a div class of “text” and you want to style that paragraph text different. In your css, you can call up:

    .text p {your styles}

    Of course this will work with other elements such as section, articles, etc. Hope that helps!

    # January 26, 2013 at 11:23 pm

    yes, but you’d have to give an example b/c the solution will definitely vary based on context.

    # January 26, 2013 at 11:37 pm

    This reply has been reported for inappropriate content.

    oh god that was stupid… -_- and i got it :P

    # January 27, 2013 at 12:21 am

    @attilahajzer, it is better not to over specify class such as

    .text p {your styles}

    but use instead generic class like:

    .text-something {your styles}


    My text

    That way you can reuse that class with other elements if necessary

Viewing 5 posts - 1 through 5 (of 5 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