1278 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+4 more
Smartik says

Guys, you really shouldn’t worry about this. Everyone has his coding style, so if you find it easier to write the CSS rules in the same line, do it so, this shouldn’t be a problem at all. Also the buyers can use a CSS beautifier and organize it however they want.

@fitwp, some rules there are just ridiculous. Why shouldn’t I use underscores to define selectors? I like using underscore, because the whole selector is selectable and I will never change this. Seriously.

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

@fitwp, some rules there are just ridiculous. Why shouldn’t I use underscores to define selectors? I like using underscore, because the whole selector is selectable and I will never change this. Seriously.
I prefer dashes for a few reasons:
  • They don’t require the shift key to type
  • They match the style of the CSS specification (:first-child, text-decoration, etc)
  • You can use the |=value operator to match attributes beginning with “value” or “value-”

An interesting bit of trivia, the original CSS spec did not allow underscores: https://developer.mozilla.org/en-US/docs/Underscores_in_class_and_ID_Names

144 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 1 year
WPEnter says

Inline CSS is this (which you shouldn’t do):
<div class="awesome" style="border: 2px solid #FDFDFD; background: #1F1F1F;" />

But it’s fine if you’re entering your style in a stylesheet like this:

.awesome {width: 100%, border: 2px solid #FDFDFD; background: #1F1F1F;}
You won’t be rejected because you’re writing it horizontally instead of vertically. You should consider which is easier for your buyers though for readability.

+1

42 posts
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 1 year
+1 more
fitwp says


@fitwp, some rules there are just ridiculous. Why shouldn’t I use underscores to define selectors? I like using underscore, because the whole selector is selectable and I will never change this. Seriously.
I prefer dashes for a few reasons:
  • They don’t require the shift key to type
  • They match the style of the CSS specification (:first-child, text-decoration, etc)
  • You can use the |=value operator to match attributes beginning with “value” or “value-”
An interesting bit of trivia, the original CSS spec did not allow underscores: https://developer.mozilla.org/en-US/docs/Underscores_in_class_and_ID_Names

+1, there’re some discussions about this that might help:

http://stackoverflow.com/q/7560813/371240 http://programmers.stackexchange.com/q/141988

By the way, coding standards is not something that forces you to follow. You can have your own style, that’s totally ok. Just keep it consistent, that’s more important.

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