34 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
ChordsofLife says

What would be a situation where someone would want to use something like

p.red { }

vs

.red {}

?

2023 posts Review Manager
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Member of the Envato Team
+12 more
jremick Envato team says

When you only want to select paragraphs with the red class vs selecting all elements with the red class. It’s just a matter of being more specific in your selection.

323 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+5 more
shadow66142000 says

Well you could be using ”.red” throughout the site but would like your paragraphs to look a little different than the rest. “p.red” is more precise and will only target a paragraph tag with the class of “red”.
.red {color: red}
p.red {color: #aa0101}

204 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
parajuli says

p.red is being SPECIFIC , it means only things inside the red class IN the p tag

however..

.red means anything which has a class of red

5 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Sirat says

Already well answered. Couldn’t have said it better. :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by